アクションメーラーSMTP Google Apps.
-
13-12-2019 - |
質問
私はMailerをSMTPでGoogle Appsで送信するように設定しようとしました。
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を実行します。Google Appsがユーザー名/パスワードを受け入れないのはなぜですか?
解決
今はうまくいきます、私は問題がユーザー名であったと思います。ユーザー名にドメインが必要です。すなわち問題は
でしたuser_name: 'username'
.
正しい方法(少なくともGoogle Appsの場合)は
user_name : 'username@mydomain.com'
. 他のヒント
これは私にとって機能します:
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "gmail.com",
:user_name => "you@gmail.com",
:password => "password",
:authentication => 'plain',
:enable_starttls_auto => true }
.
ドメインをgmail.comに設定してみてください
所属していません StackOverflow