Skip to content

Instantly share code, notes, and snippets.

@albertico
Last active August 29, 2015 13:56
Show Gist options
  • Save albertico/9176341 to your computer and use it in GitHub Desktop.
Save albertico/9176341 to your computer and use it in GitHub Desktop.
Mandrill Example (Ruby)
#!/usr/bin/env ruby
require 'mail'
Mail.defaults do
delivery_method :smtp, { :address => "smtp.mandrillapp.com",
:port => 587,
:user_name => "YOUR_MANDRILL_USERNAME",
:password => "YOUR_API_KEY",
:authentication => 'plain',
:enable_starttls_auto => true }
end
mail = Mail.deliver do
to 'to@email.com'
from 'from@email.com'
subject 'Testing Mandrill'
text_part do
body 'Mandrill message! Yeah!!'
end
html_part do
content_type 'text/html; charset=UTF-8'
body '<b>Mandrill message! Yeah!!</b>'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment