我正在使用带有Rails的MailCatcher,但它不能工作。在rails控制台上,我做到了:
> Signup.confirm_email(User.second).deliver
我得到了:
Rendered signup/confirm_email.html.erb (2.2ms)
Rendered signup/confirm_email.text.erb (0.6ms)
Signup#confirm_email: processed outbound mail in 246.1ms
Sent mail to hi@example.com (7.0ms)
Date: Mon, 05 Jan 2015 00:55:03 -0200
From: no-reply@hello.com
To: hi@example.com
Message-ID: <54a9fd0740a1c_18f1115f968218f9@Leonardo.mail>
Subject: Confirm your email :)
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_54a9fd073f97f_18f1115f96821751";
charset=UTF-8
Content-Transfer-Encoding: 7bit
但在localhost:1080和我的电子邮件中什么也没有出现。
这是我的文件和文件夹的打印:http://imgur.com/udxkhYj
和代码:
mailers/signup.rb
class Signup < ActionMailer::Base
default from: 'no-reply@hello.com'
def confirm_email(user)
@user = user
@confirmation_link = root_url
mail({
:to => user.email,
:bcc => ['sign ups <signups@hello.com>'],
:subject => I18n.t('signup.confirm_email.subject')
})
end
end
config/environment/development.rb
Rails.application.configure do
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }
end
我该怎么办?
发布于 2015-01-06 08:00:42
好吧,问题出在eventmachine 1.0.4。我安装了1.0.3,现在可以工作了:)
https://stackoverflow.com/questions/27772915
复制相似问题