1

I'm using MailCatcher with Rails, but is is not working. On rails console, I did:

> Signup.confirm_email(User.second).deliver

And I got that:

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

But nothing appears at localhost:1080 and at my email.

Here is a print of my files and folders: http://imgur.com/udxkhYj

And code:

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

What should I do?

4

1 回答 1

1

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

于 2015-01-06T00:00:41.853 回答