Last active
August 29, 2015 14:02
-
-
Save djabif/43a9975d316b35685ec9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
post '/contact/send-mail' do | |
body = "Name: #{params[:name]} <br /> Email: #{params[:email]} | |
<br /> Company: #{params[:company]} <br /> Skype: #{params[:skype]} | |
<br /> <br /> Message: #{params[:message]}" | |
Pony.mail({ | |
:to => '[email protected]', | |
:from => '[email protected]', | |
:subject => 'Learning how to send an email from Ruby', | |
:body => body, | |
:via => :smtp, | |
:headers => { 'Content-Type' => 'text/html' }, | |
:via_options => { | |
:address => 'smtp.gmail.com', | |
:port => '587', | |
:user_name => '[email protected]', | |
:password => 'yourpassword', | |
:authentication => :plain, | |
:domain => "yourdomain.com" | |
} | |
}) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment