내 레일 사이트에서 Gmail을 통해 메일을 보내려고하면 완벽하게 작동합니다.Rails Mailer Net :: SMTPServerBusy
# ActionMailer Config
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.default :charset => "utf-8"
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
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 }
config.action_mailer.smtp_settings = {
:address => "smtp.mandrillapp.com",
:port => 587,
:user_name => ENV["EMAIL"],
:password => ENV["PASSWORD"]
}
:
Net::SMTPServerBusy in RController#create
454 4.7.1 <[email protected]>: Relay access denied
가 여기 내 설정/환경/development.rb 파일이다 : 나는 MandrillApp를 통해 보내려고 할 때, 그것은합니다 (명령이 호출 제공하는 곳 RController.create는) 다음과 같은 오류를 제공합니다
위와 같이 코드가 작동하지 않습니다. 전자 메일을받지 못하고 오류 팝업이 표시되지 않습니다. Gmail에서 보내는 것으로 전환하면 즉시 이메일이 전송됩니다. 나는 전에 Mandrill에서 일한 적이 없기 때문에 어떤 도움을 주시면 감사하겠습니다.
고마워요. 저에게 도움이되었습니다. 당신은 당신 자신의 대답을 받아 들여야합니다. 나는 ENV와 EMAIL 같은'[]'을 제거해야만했다. – LearningRoR
솔루션을 명확히 할 수 있습니까? 현재 내 smtp_settings - : password => ENV [ 'MANDRILL_API_KEY']에이 줄이 있습니다. 당신의 해결책에 따르면, 어떻게이 줄을 읽어야합니까? – ajporterfield
MANDRILL_API_KEY를 환경 변수가 아닌 프로그램 변수로 정의하는 경우'password => ENV [ 'MANDRILL_API_KEY']'대신'password => MANDRILL_API_KEY' 만 필요합니다. 환경 변수는 더 안전합니다. API 키가 사이트가 아닌 컴퓨터/서버에 저장되므로 (기본적으로 누군가 코드를 보유 할 수 있지만 여전히 키를 가져올 수 없음) 일반적인 변수 구현하기가 더 쉽습니다 - 보안에 얼마나 관심이 있는지에 달려 있습니다 (환경 변수를 올바르게 작성해야하지만). – camdroid