首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >MailCatcher没有发送电子邮件

MailCatcher没有发送电子邮件
EN

Stack Overflow用户
提问于 2015-01-05 11:10:59
回答 1查看 915关注 0票数 1

我正在使用带有Rails的MailCatcher,但它不能工作。在rails控制台上,我做到了:

代码语言:javascript
运行
复制
> Signup.confirm_email(User.second).deliver

我得到了:

代码语言:javascript
运行
复制
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

代码语言:javascript
运行
复制
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

代码语言:javascript
运行
复制
Rails.application.configure do
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }
end

我该怎么办?

EN

回答 1

Stack Overflow用户

发布于 2015-01-06 08:00:42

好吧,问题出在eventmachine 1.0.4。我安装了1.0.3,现在可以工作了:)

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27772915

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档