0

我有一个使用Amazon SES服务向客户发送信息电子邮件的Rails应用程序。在开发环境中,此电子邮件功能正常运行。但是,当我在我的EC2实例中运行我的应用程序时,电子邮件不再发送。Amazon SES电子邮件传送问题

我检查了日志,一切看起来不错:

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

Sent mail to [email protected] (25.8ms) 
Date: Mon, 03 Nov 2014 11:17:57 +0000 
From: Yanpy <[email protected]> 
To: [email protected] 
Message-ID: <[email protected]> 
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: <[email protected]> 

iVBORw0KGgoAAAANSUhEUgAAAWAAAAB5CAYAAAAHz/urAAAACXBIWXMAAAsT 
AAALEwEAmpwYAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3... 

----==_mimepart_5457646554c90_1be3fd803f643b4536a1-- 

我已经检查[email protected]是验证发件人的电子邮件地址。我甚至从SES控制台发送了一封来自[email protected]的测试邮件到[email protected],并发送和收到了该电子邮件。

但是,当我以编程方式发送这些电子邮件时,一切看起来不错,但电子邮件没有收到。

回答

0

我修好了。我意识到我错过了我的测试环境在Rails中的smtp配置。

我说:

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 
    } 

在我的Rails环境/ test.rb配置文件,它的工作。

相关问题