Action mailer SMTP google apps

Viewed 8392

I tried to configure actionmailer to send via google apps with smtp.

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address              => "smtp.gmail.com",
:port                 => 587,
:domain               => "mydomain.com",
:user_name            => "username",
:password             => "password",
:authentication       => 'plain',
:enable_starttls_auto => true  }

config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true

However whenever gitlab tries to send an e-mail:

Sent mail to user@my.domain.com (10ms)
Completed 500 Internal Server Error in 29ms

535-5.7.1 Username and Password not accepted

Server runs ruby 1.9.3p194. Why doesn't google apps accept the username/password?

2 Answers
Related