2013-08-29 3 views
1

이 코드는 개발시 완벽하게 작동하며 전자 메일은 동일한 구성을 갖고 있더라도 프로덕션에 도착하지 않습니다.Rails ActionMailer가 프로덕션 환경에서 전자 메일을 보내지 않습니다. 오류 없음

구성 : 이메일 보내기

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

:

logger.warn "before mail call" 
logger.warn ActionMailer::Base.smtp_settings 
logger.warn(mail(to: "[email protected]", subject: "Testing", body: "email body").deliver!) 

서버 로그 : 그것은 완벽하게 작동 내 로컬 호스트 개발에

[2013-08-29 16:41:11.000] [WARN] -- before mail call 
[2013-08-29 16:41:11.000] [WARN] -- {:address=>"smtp.gmail.com", :port=>587, :authentication=>:plain, :user_name=>"[email protected]", :password=>"secret", :enable_starttls_auto=>true} 
[2013-08-29 16:41:11.000] [WARN] -- Date: Thu, 29 Aug 2013 16:41:11 +0200 
From: [email protected] 
To: [email protected] 
Message-ID: <[email protected]> 
Subject: Testing 
Mime-Version: 1.0 
Content-Type: text/plain; 
charset=UTF-8 
Content-Transfer-Encoding: 7bit 

email body 

. 이메일은 거의 즉시 도착합니다. 생산 과정에서 이메일이 도착하지 않으며 오류가 발생하지 않습니다. 나는 이미 많은 조합의 설정 (with/without : enable_starttls_auto, : domain, delivery_method, perform_deliveries 등 설정하지 않음)을 시도했으며 지금까지 아무 것도 작동하지 않았습니다. 나는 또한 성공하지 못한 다른 이메일로 보내려고했다.

아이디어가 있으십니까? 미리 감사드립니다.

+0

를 사용하는 참조 사용하는 Gmail의 SMTP 포트는 465입니다 말하고있다? 같은 문제가 있습니다. – GMA

+0

@GeorgeMillo 예, 실제로는 어리석은 실수였습니다. 'config.action_mailer.delivery_method'는 파일의 끝에'test'에 겹쳐 쓰여지고 있었기 때문에 아무 것도 전송되지 않았습니다. – Clash

답변

0

메일 설정에 올바른 주소 인 이메일 주소를 추가해보십시오. 이 바로 전에 이메일을 차단했습니다. 어쩌면 admin @ 사이트가 호스팅 된 도메인 이름과 같은 것일 수 있습니까?

mail(to: "[email protected]", subject: "Testing", body: "email body", from: "[email protected]").deliver! 
+0

제안을 시도했지만 작동하지 않았습니다. 어딘가에서 오류가 발생하지 않아야합니까? – Clash

+0

사실 개발에서 작동하고 오류가 없다는 사실은 실제로 메일러 문제가 아니며 서버와 관련이있을 가능성이 높다는 것을 나에게 제안합니다. 차단되거나 전자 메일을 보낼 수 없습니다. . 당신이 연락 할 수있는 서버 관리자가 있습니까? –

관련 문제