Skip to content

Instantly share code, notes, and snippets.

@ardian
Created December 8, 2014 23:23
Show Gist options
  • Save ardian/53fd70818684976a186a to your computer and use it in GitHub Desktop.
Save ardian/53fd70818684976a186a to your computer and use it in GitHub Desktop.
Ruby code to send email
require 'mail'
options = { :address => "smtp.gmail.com",
:port => 587,
:domain => 'gmail.com',
:user_name => '[email protected]',
:password => 'password',
:authentication => 'plain',
:enable_starttls_auto => true }
Mail.defaults do
delivery_method :smtp, options
end
Mail.deliver do
to '[email protected]'
from '[email protected]'
subject 'testing sendmail'
body 'testing sendmail'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment