Skip to content

Instantly share code, notes, and snippets.

@aboutaaron
Created October 17, 2012 23:47
Show Gist options
  • Save aboutaaron/3909049 to your computer and use it in GitHub Desktop.
Save aboutaaron/3909049 to your computer and use it in GitHub Desktop.
Ruby Mail auth
options = { :address => "smtp.gmail.com",
:port => 587,
:domain => 'gmail.com',
:user_name => user_name,
:password => password,
:authentication => 'plain',
:enable_starttls_auto => true }
Mail.defaults do
delivery_method :smtp, options
# https://github.com/mikel/mail/blob/master/lib/mail/network/retriever_methods/imap.rb
retriever_method :imap, { :address => "imap.googlemail.com",
:port => 993,
:user_name => user_name,
:password => password,
:enable_ssl => true }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment