Pass Credentials to ActionMailer's SMTP Settings from Google OAuth2

125 views
Skip to first unread message

Max Lee

unread,
May 15, 2014, 11:08:36 PM5/15/14
to mail...@googlegroups.com
Hi,

I'm trying to send out emails by using ActionMailer's SMTP from my Gmail account logged in via Google OAuth2. 

How can I enter this user credentials such as user_name and password retrieved from Google OAuth2 into the following SMTP settings:

{
  :address => "smtp.gmail.com",
  :port => 587,
  :user_name => '<user...@gmail.com>',
  :password => '<password>',
  :authentication => "plain",
  :enable_starttls_auto => true
}

Carson Reinke

unread,
May 16, 2014, 4:32:11 PM5/16/14
to mail...@googlegroups.com
Correct if I am wrong, but the Gmail OAuth2 requires "XOAUTH2" and not "PLAIN".  The actual SMTP implementation is in Net::SMTP, but I bet you can patch that to allow for the new authentication type.
Reply all
Reply to author
Forward
0 new messages