简体   繁体   English

无法从开发环境发送电子邮件给我们亚马逊SES

[英]can't send email usign amazon SES from development enviroment

I'm trying to change my mandrilapp configuration to amazon ses in order to send emails from my rails app, but when I try to test, rails does not gave any error, but the email never array. 我试图将我的mandrilapp配置更改为Amazon ses,以便从Rails应用程序发送电子邮件,但是当我尝试测试时,Rails并没有给出任何错误,但是电子邮件从不排列。

I have two verified address from my ses management console, but I don't understand why I can't send emails. 我在ses管理控制台中有两个经过验证的地址,但是我不明白为什么我无法发送电子邮件。

I have the following configuration: 我有以下配置:

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', 
  }

any idea? 任何想法?

Thanks 谢谢

UPDATE 更新


I uploaded my code to heroku but when I sign up to create a new user I get the following error: 我将代码上传到heroku,但是在注册创建新用户时出现以下错误:

Aws::Errors::MissingCredentialsError (unable to sign request without credentials set) Aws :: Errors :: MissingCredentialsError(无法在未设置凭据的情况下签署请求)

but as you can see I have my user and pass credential. 但如您所见,我有我的用户并通过了证书。

What I'm doing wrong? 我做错了什么?

Thanks 谢谢

I've successfully shipped an app using SES with the following setup. 我已经通过以下设置成功使用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

You must also set the default URL options - config.action_mailer.default_url_options . 您还必须设置默认URL选项config.action_mailer.default_url_options

More information is available on the GitHub README . GitHub README上提供了更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM