Skip to content

Instantly share code, notes, and snippets.

@brandonmwest
Created February 22, 2013 20:22
Show Gist options
  • Select an option

  • Save brandonmwest/5016294 to your computer and use it in GitHub Desktop.

Select an option

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 => '[email protected]',
:via => :smtp,
:via_options => {
:address => 'smtp.sendgrid.net',
:port => '587',
:user_name => 'sendgriduser',
:password => 'sendgridpassword',
:authentication => :plain
}
}
message = Pony.mail :to => '[email protected]', :from => '[email protected]', :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