Created
February 4, 2014 23:46
-
-
Save TheNaoX/8814767 to your computer and use it in GitHub Desktop.
Here's a basic example of how to use the Mail gem without action mailer on rails.
This file contains 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
recipients = ['email@example.com'] | |
mail_body = <<-HTML | |
Hello world! | |
HTML | |
mail = Mail.new do | |
delivery_method( | |
:smtp, | |
:address => "address", | |
:port => "port", | |
:authentication => :plain, | |
:user_name => "username", | |
:password => "password", | |
:domain => "domain" | |
) | |
from 'John Doe <john@doe.com>' | |
to 'email@sample.com' | |
bcc user_emails | |
subject 'Hi this is a test email' | |
body mail_body | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment