Reputation: 644
I'm trying to send an email using Ruby on Rails but I get the error:
Net::SMTPAuthenticationError in UsersController#create
535-5.7.1 Username and Password not accepted.
But the username and password combination is correct. I've gone through it multiple times.
This is my setup_mail.rb:
I changed the username, password and domain for privacy reasons.
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "mydomain.com",
:authentication => "plain",
:user_name => "myname",
:password => "mypw",
:enable_starttls_auto => true
}
Upvotes: 4
Views: 1955
Reputation: 9226
Your username has to be
:user_name => "[email protected]"
For gmail the domain is required.
Upvotes: 2
Reputation: 16619
Check if this link is helpful
https://github.com/diaspora/diaspora/issues/1539
http://www.manu-j.com/blog/wordpress-exim4-ubuntu-gmail-smtp/75/
Net::SMTPAuthenticationError in rails 3.1.0.rc5 when connecting to gmail
thanks
sameera
Upvotes: 0