이 코드는 개발시 완벽하게 작동하며 전자 메일은 동일한 구성을 갖고 있더라도 프로덕션에 도착하지 않습니다.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 등 설정하지 않음)을 시도했으며 지금까지 아무 것도 작동하지 않았습니다. 나는 또한 성공하지 못한 다른 이메일로 보내려고했다.
아이디어가 있으십니까? 미리 감사드립니다.
를 사용하는 참조 사용하는 Gmail의 SMTP 포트는 465입니다 말하고있다? 같은 문제가 있습니다. – GMA
@GeorgeMillo 예, 실제로는 어리석은 실수였습니다. 'config.action_mailer.delivery_method'는 파일의 끝에'test'에 겹쳐 쓰여지고 있었기 때문에 아무 것도 전송되지 않았습니다. – Clash