Skip to content

Instantly share code, notes, and snippets.

@pedrodelgallego
Created October 27, 2010 07:30
Show Gist options
  • Save pedrodelgallego/648619 to your computer and use it in GitHub Desktop.
Save pedrodelgallego/648619 to your computer and use it in GitHub Desktop.
A working example of pony and sinatra.
# You need to install these gems.
# - smtp_tls
# - pony
post "/contact-us" do
Pony.mail :to => 'pedro.delgallego@gmail.com',
:from => "#{params[:email]}",
:subject => "Contact SFT : #{params[:name]}",
:body=> "#{params[:body]}, --- Contact Address #{params[:email]}",
:via => :smtp,
:smtp => {
:host => 'smtp.gmail.com',
:port => '587',
:tls => true,
:user => 'pedro.delgallego',
:password => 'your-gmail-password',
:auth => :plain,
:domain => "your-domain."
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment