0

Thanks in advance for the assistance.

I'm using Mailcatcher in dev to see how emails sent by my app look, but I'm not seeing anything in the mailcatcher interface.

Here's what I have so far:

config/environment/development.rb

 config.action_mailer.default_url_options =  { :host  => 'localhost: 3000' }
 config.action_mailer.delivery_method = :smtp
 config.action_mailer.smtp_settings = { address: '127.0.0.1', :port => 1025 }

models/user.rb

class User < ActiveRecord::Base

  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable, :confirmable,
         :recoverable, :rememberable, :trackable, :validatable

end

Server Logs

Devise::Mailer#confirmation_instructions: processed outbound mail in 5.5ms

Sent mail to test@gmail.com (60006.9ms)
Date: Mon, 12 Jan 2015 11:51:41 +0800
From: please-change-me-at-config-initializers-devise@example.com
Reply-To: please-change-me-at-config-initializers-devise@example.com
To: test@gmail.com
Message-ID: <54b344cd46482_5273fcf9d4fa0a410014d@Jamesons-MBP.mail>
Subject: Confirmation instructions
Mime-Version: 1.0
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

<div class="container">
  <div class="row">
    <div class="col-md-4 col-md-offset-1 devise-form">
<p>Welcome test@gmail.com!</p>

<p>You can confirm your account email through the link below:</p>

<p><a href="http://localhost:3000/users/confirmation?confirmation_token=2PpW7PADs1Sc2dGTkHKa">Confirm my account</a></p>
    </div>
  </div>
</div>
   (9.3ms)  commit transaction
Redirected to http://localhost:3000/
Completed 302 Found in 60110ms (ActiveRecord: 9.9ms)

As far as I can tell, the email is sending, and if I manually copy the confirmation link from the server logs, I can confirm the account, but I would like to see the mail in the mailcatcher interface.

Any idea what I might be doing wrong here? Thanks again.

There is a similar question here - Rails 4 with MailCatcher and Devise gems, but the solution is to remove data from config/environments.rb, which doesn't apply to my situation, as I haven't added any data to that file.

Community
  • 1
  • 1
jmknoll
  • 1,046
  • 5
  • 11
  • 30
  • This might be relevant: http://stackoverflow.com/a/20770131/4035338 – sjaime Jan 12 '15 at 09:32
  • config.action_mailer.raise_delivery_errors = true This will raise an error if your email is not actually sent. Won't solve the problem but useful in Development to catch the error. – Peter Todd Apr 12 '15 at 16:01
  • Try launching mailcatcher with --verbose to have more details on what's going on – Stephane Paquet Aug 07 '17 at 05:38

0 Answers0