Skip to content

Instantly share code, notes, and snippets.

@brandonmwest
Created February 22, 2013 20:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandonmwest/5016294 to your computer and use it in GitHub Desktop.
Save brandonmwest/5016294 to your computer and use it in GitHub Desktop.
Send email from SendGrid using Pony gem
require 'rubygems'
require 'pony'
#set the default options
Pony.options = {
:from => 'demo@sendgrid.com',
:via => :smtp,
:via_options => {
:address => 'smtp.sendgrid.net',
:port => '587',
:user_name => 'sendgriduser',
:password => 'sendgridpassword',
:authentication => :plain
}
}
message = Pony.mail :to => 'brandon.west@sendgrid.com', :from => 'brawest@gmail.com', :subject => 'SendGrid Delivered!', :body => 'Hello there. You look great today!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment