亚马逊 AWS 发送电子邮件表格 RoR
Amazon AWS send email form RoR
我正在尝试使用远程 smtp 主机从我的 RoR 应用程序发送电子邮件。
这在我的本地服务器上进行生产和开发。
当我设置
config.action_mailer.raise_delivery_errors
为真,我在日志中收到此错误
Error during failsafe response: 550-sender IP address xx.xx.xxx.xxx is part of Amazon AWS, and may not use this
/usr/local/lib/ruby/2.2.0/net/smtp.rb:964:in `check_response'
/usr/local/lib/ruby/2.2.0/net/smtp.rb:933:in `getok'
/usr/local/lib/ruby/2.2.0/net/smtp.rb:869:in `rcptto'
/usr/local/lib/ruby/2.2.0/net/smtp.rb:850:in `block in rcptto_list'
/usr/local/lib/ruby/2.2.0/net/smtp.rb:848:in `each'
/usr/local/lib/ruby/2.2.0/net/smtp.rb:848:in `rcptto_list'
这是我的操作邮件设置
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: "smtp.thehostname.com",
port: 587,
domain: 'MyDomain.net',
user_name: 'MyUsername',
password: 'MyPassword',
authentication: 'plain',
enable_starttls_auto: true
}
并且我已经在我的生产环境中设置了这个设置
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_deliveries = true
config.action_mailer.default_url_options = { :host => "subdomain.mydomain.net" }
有谁知道为什么我无法从亚马逊 AWS 发送邮件?
我相信 EC2 限制出站 SMTP 流量以防止垃圾邮件。有一个 support request form 可以删除限制。
或者您可以使用 SES.
我正在尝试使用远程 smtp 主机从我的 RoR 应用程序发送电子邮件。 这在我的本地服务器上进行生产和开发。
当我设置
config.action_mailer.raise_delivery_errors
为真,我在日志中收到此错误
Error during failsafe response: 550-sender IP address xx.xx.xxx.xxx is part of Amazon AWS, and may not use this
/usr/local/lib/ruby/2.2.0/net/smtp.rb:964:in `check_response'
/usr/local/lib/ruby/2.2.0/net/smtp.rb:933:in `getok'
/usr/local/lib/ruby/2.2.0/net/smtp.rb:869:in `rcptto'
/usr/local/lib/ruby/2.2.0/net/smtp.rb:850:in `block in rcptto_list'
/usr/local/lib/ruby/2.2.0/net/smtp.rb:848:in `each'
/usr/local/lib/ruby/2.2.0/net/smtp.rb:848:in `rcptto_list'
这是我的操作邮件设置
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: "smtp.thehostname.com",
port: 587,
domain: 'MyDomain.net',
user_name: 'MyUsername',
password: 'MyPassword',
authentication: 'plain',
enable_starttls_auto: true
}
并且我已经在我的生产环境中设置了这个设置
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_deliveries = true
config.action_mailer.default_url_options = { :host => "subdomain.mydomain.net" }
有谁知道为什么我无法从亚马逊 AWS 发送邮件?
我相信 EC2 限制出站 SMTP 流量以防止垃圾邮件。有一个 support request form 可以删除限制。
或者您可以使用 SES.