我跟着THIS关于如何使用RoR发送电子邮件的网站。运行服务器和调用该方法后,它显示在控制台:使用RoR发送电子邮件
Rendered user_mailer/welcome_email.html.erb (1.0ms)
Rendered user_mailer/welcome_email.text.erb (1.0ms)
Sent mail to [email protected] (1128ms)
Date: Sun, 18 Sep 2011 13:44:49 +0530
From: [email protected]
To: [email protected]
Message-ID: <[email protected]>
Subject: Welcome to My Awesome Site
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_4e75a878df4a2_ed81feda646659d";
charset=UTF-8
Content-Transfer-Encoding: 7bit
.......
,但我没有收到在我的收件箱的任何电子邮件。可能有人请告诉我什么是这里的问题...
感谢apneadiving ...但现在我收到一个错误:'Errno :: ECONNREFUSED(无法建立连接,因为目标机器主动拒绝它 - connect(2)):'on the line in the controller我称之为“交付”。你能告诉我任何解决办法吗? –
你有什么错误? – apneadiving
我在我的登录控制器中调用递送方法。我按如下方式调用递送方法:'UserMailer.welcome_email(user).deliver'。如果我调用递送方法,我得到错误:'Errno :: ECONNREFUSED(由于目标机器主动拒绝连接,所以无法连接 - connect(2)):app/controllers/login_controller.rb:16:登录',但是如果我评论它,那么登录成功按需要。 –