문제

SMTP로 Google Apps를 통해 보내려면 ActionMailer를 구성하려고했습니다.

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가 사용자 이름 / 암호를 허용하지 않는 이유는 무엇입니까?

도움이 되었습니까?

해결책

지금 작동합니다. 문제가 사용자 이름과 함께 있었다고 생각합니다.사용자 이름에는 도메인이 필요합니다.I.E.E. 문제는

였습니다
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으로 설정하십시오

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top