Skip to content

Instantly share code, notes, and snippets.

@daz4126
Created March 5, 2012 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daz4126/1977178 to your computer and use it in GitHub Desktop.
Save daz4126/1977178 to your computer and use it in GitHub Desktop.
DAZ4126 Contact form code
post '/' do
require 'pony'
Pony.mail(
from: "DAZ4126<daz4126@gmail.com>",
to: 'daz4126@gmail.com',
subject: "A message from the DAZ4126 website",
body: params[:message],
port: '587',
via: :smtp,
via_options: {
:address => 'smtp.sendgrid.net',
:port => '587',
:enable_starttls_auto => true,
:user_name => ENV['SENDGRID_USERNAME'],
:password => ENV['SENDGRID_PASSWORD'],
:authentication => :plain,
:domain => 'heroku.com'
})
redirect '/success'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment