Skip to content

Instantly share code, notes, and snippets.

@vparihar01
Created July 29, 2013 12:36
Show Gist options
  • Save vparihar01/6104015 to your computer and use it in GitHub Desktop.
Save vparihar01/6104015 to your computer and use it in GitHub Desktop.
require 'mail'
Mail.defaults do
delivery_method :smtp, { :address => "smtp.sendgrid.net",
:port => 587,
:domain => "xyz.com",
:user_name => "xyz@zyz.com",
:password => "xyz",
:authentication => 'plain',
:enable_starttls_auto => true }
end
mail = Mail.deliver do
to 'vivek@weboniselab.com'
from 'vivek@weboniselab.com'
subject 'This is the subject of your email'
text_part do
body 'Hello world in text'
end
html_part do
content_type 'text/html; charset=UTF-8'
body '<b>Hello world in HTML</b>'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment