2011-02-17 256 views
5

我想通過我的Gmail帳戶發送電子郵件。我直接從rails guide複製了代碼,而在我的終端中,它說它正在發送消息,但是我發送給它的地址沒有得到它。下面是我在我的env.rb文件從Gmail Rails發送電子郵件3

config.action_mailer.deconfig.action_mailer.delivery_method = :smtp 
config.action_mailer.smtp_settings = { 
    :address    => "smtp.gmail.com", 
    :port     => 587, 
    :domain    => 'derp' 
    :user_name   => 'derp.bot', 
    :password    => 'derp42069', 
    :authentication  => 'plain', 
    :enable_starttls_auto => true } 

在終端的代碼中,我得到了以下信息:

Sent mail to [email protected] (20ms) 
Date: Wed, 16 Feb 2011 23:09:54 -0800 
From: [email protected] 
To: [email protected] 
Message-ID: <[email protected]> 
Subject: New Task 
Mime-Version: 1.0 
Content-Type: text/html; 
charset=UTF-8 
Content-Transfer-Encoding: 7bit 

you suck 
Rendered need_router/index.html.erb within layouts/application (2.1ms) 
Completed 200 OK in 371ms (Views: 8.3ms) 

但是我要送它的電子郵件沒有收到消息。任何幫助將不勝感激。

+2

我認爲你的用戶名需要是「[email protected]」,而不僅僅是「用戶名」部分。 – 2011-02-17 07:39:09

回答