简体   繁体   English

Amazon SES电子邮件传递问题

[英]Amazon SES email delivery problems

I have a rails application that is using Amazon SES service to send information emails to customers. 我有一个使用Amazon SES服务将信息电子邮件发送给客户的Rails应用程序。 In development environment this email functionality is working ok. 在开发环境中,此电子邮件功能正常运行。 However, when I run my application in my EC2 instance the emails are not sent anymore. 但是,当我在EC2实例中运行应用程序时,不再发送电子邮件。

I have checked the logs, and everything looks good: 我已经检查了日志,一切看起来都很好:

Rendered email_service/send_booking_request_customer_notification.html.erb (7.6ms)

Sent mail to cliente.yanpy@gmail.com (25.8ms)
Date: Mon, 03 Nov 2014 11:17:57 +0000
From: Yanpy <business@yanpy.com>
To: cliente.yanpy@gmail.com
Message-ID: <5457646572252_1be3fd803f643b45382f@ip-172-31-20-213.mail>
Subject: Nueva solicitud de reserva [MMSGORDH].
Mime-Version: 1.0
Content-Type: multipart/related;
 boundary="--==_mimepart_5457646554c90_1be3fd803f643b4536a1";
 charset=UTF-8
Content-Transfer-Encoding: 7bit


----==_mimepart_5457646554c90_1be3fd803f643b4536a1
Content-Type: multipart/alternative;
 boundary="--==_mimepart_545764656fbba_1be3fd803f643b4537bb";
 charset=UTF-8
Content-Transfer-Encoding: 7bit


----==_mimepart_545764656fbba_1be3fd803f643b4537bb
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: quoted-printable

[text-content]

----==_mimepart_545764656fbba_1be3fd803f643b4537bb
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html>
[html-content]

----==_mimepart_545764656fbba_1be3fd803f643b4537bb--

----==_mimepart_5457646554c90_1be3fd803f643b4536a1
Content-Type: image/png;
 charset=UTF-8;
 filename=logo.png
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename=logo.png
Content-ID: <545764654ea73_1be3fd803f643b4535ba@ip-172-31-20-213.mail>

iVBORw0KGgoAAAANSUhEUgAAAWAAAAB5CAYAAAAHz/urAAAACXBIWXMAAAsT
AAALEwEAmpwYAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3...

----==_mimepart_5457646554c90_1be3fd803f643b4536a1--

I have checked business@yanpy.com is a verified sender email address. 我已检查business@yanpy.com是已验证的发件人电子邮件地址。 I even have sent a test email from SES console from business@yanpy.com to cliente.yanpy@gmail.com and the email is sent and received. 我什至从SES控制台发送了一封测试电子邮件,从business@yanpy.com发送到cliente.yanpy@gmail.com,并且电子邮件已经发送和接收。

However, when I send these emails programatically, everything looks good, but the emails are not received. 但是,当我以编程方式发送这些电子邮件时,一切看起来不错,但未收到电子邮件。

I fixed it. 我修好了它。 I have realized I was missing my smtp configuration for my test environment in Rails. 我意识到我在Rails的测试环境中缺少了smtp配置。

I added: 我补充说:

config.action_mailer.delivery_method = :smtp
    config.action_mailer.smtp_settings = {
        :address => "email-smtp.eu-west-1.amazonaws.com",
        :user_name => "************", # Your SMTP user here.
        :password => "*************", # Your SMTP password here.
        :authentication => :login,
        :enable_starttls_auto => true
    }

to my environments/test.rb config file in Rails and it worked. 到我在Rails中的environment / test.rb配置文件,它起作用了。

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

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