[英]How to send emails using Amazon SES without verifying 'from' email address
[英]can't send email usign amazon SES from development enviroment
我试图将我的mandrilapp配置更改为Amazon ses,以便从Rails应用程序发送电子邮件,但是当我尝试测试时,Rails并没有给出任何错误,但是电子邮件从不排列。
我在ses管理控制台中有两个经过验证的地址,但是我不明白为什么我无法发送电子邮件。
我有以下配置:
config.action_mailer.delivery_method = :aws_sdk
config.action_mailer.smtp_settings = {
:address => "email-smtp.eu-west-1.amazonaws.com",
:port => 465,
:enable_starttls_auto => true,
:user_name => "blablablausername",
:password => "blablablablablablapassword",
:authentication => 'login',
:ssl => true,
:domain => 'mydomain.es',
}
任何想法?
谢谢
更新
我将代码上传到heroku,但是在注册创建新用户时出现以下错误:
Aws :: Errors :: MissingCredentialsError(无法在未设置凭据的情况下签署请求)
但如您所见,我有我的用户并通过了证书。
我做错了什么?
谢谢
我已经通过以下设置成功使用SES交付了一个应用程序。
# Gemfile
gem 'aws-ses', '~> 0.6.0', require: 'aws/ses'
# config/initializers/amazon_ses.rb
ActionMailer::Base.add_delivery_method :ses, AWS::SES::Base,
access_key_id: Rails.application.secrets.amazon_access_key,
secret_access_key: Rails.application.secrets.amazon_secret_key,
server: 'email.us-west-2.amazonaws.com'
# config/environments/development(or production).rb
config.action_mailer.delivery_method = :ses
您还必须设置默认URL选项config.action_mailer.default_url_options
。
GitHub README上提供了更多信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.