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配置文件,它的工作。

相關問題