Last active
August 29, 2015 13:56
-
-
Save albertico/9176341 to your computer and use it in GitHub Desktop.
Mandrill Example (Ruby)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 '[email protected]' | |
from '[email protected]' | |
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