Skip to content

Instantly share code, notes, and snippets.

@TheNaoX
Created February 4, 2014 23:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheNaoX/8814767 to your computer and use it in GitHub Desktop.
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.
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