2012-07-29 6 views
7

smtp를 사용하여 google apps를 통해 보낼 actionmailer를 구성하려고했습니다.조치 메일러 SMTP google apps

Sent mail to [email protected] (10ms) 
Completed 500 Internal Server Error in 29ms 

535-5.7.1 Username and Password not accepted 

서버가 루비 1.9.3p194을 실행합니다 gitlab 전자 메일을 보내려고하지만 때마다

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 

. Google 앱이 사용자 이름/비밀번호를 허용하지 않는 이유는 무엇입니까?

+1

Gmail 계정에 로그인 해보십시오. 앱에 대한 사용 권한을 부여해야 할 수도 있습니다. –

+0

@KyleC 이미 시도했습니다. 내 앱이 액션 메일러입니다. SMTP에 대한 사용 권한을 부여해야합니까? – Jubei

+2

아니요. 개발 (로컬 컴퓨터) 또는 프로덕션에서 이러한 오류가 발생합니까? –

답변

10

이제는 문제가 사용자 이름과 관련 있다고 생각합니다. 그것은 사용자 이름에 도메인이 필요합니다.

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

은 gmail.com으로 도메인을 설정하십시오 : (적어도 구글 애플 리케이션을위한) 올바른 방법이

user_name : '[email protected]' 
5

이 나를 위해 작동되는 반면, 즉 문제는

user_name: 'username' 

이었다

+0

고맙습니다. gmail.com에 대해서도 작동하지만 Google Apps 도메인에는 적합하지 않습니다. 감사합니다. – Jubei