我尝试将 actionmailer 配置为使用 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
但是,每当 gitlab 尝试发送电子邮件时:
Sent mail to user@my.domain.com (10ms)
Completed 500 Internal Server Error in 29ms
535-5.7.1 Username and Password not accepted
服务器运行 ruby 1.9.3p194。为什么谷歌应用程序不接受用户名/密码?