2011-02-17 193 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

回答