Mailtrap and Mailshovel: Simple Rails mailer testing31 Mar 08

Mailtrap is a minimal SMTP server that runs on your development machine. Actionmailer can talk to it. I've just added Mailshovel, a minimal POP3 server, that will talk to your email program. This means that you can:

  1. Run 'mailtrap start'
  2. Test your Rails app on localhost
  3. Receive the sent emails in real email programs

It saves you from setting up dummy email accounts and real SMTP servers, and it's better than tailing the logs, because it allows you to check for formatting problems. I use it to help with complex mime/multipart + attachment messages.

This is based on the work of Matt Mower (matt.blogs.it). Coming soon: a re-released mailtrap, which will mean that you can get this whole thing with just 'gem install mailtrap'.

Until then, grab it from git, build the gem, and install it:

http://github.com/gwynm/mailtrap/tree/master

Patches welcome; it's probably best to fork the git repository, then send me a pull request. I'd like to play with this git thing more.

If "grab it from git, build the gem, and install it" wasn't very helpful, you can check out my more detailed article on github.

Gwyn said on 25 Apr 2008:

If you're getting badly formatted mails (particularly if sent from Merb), make sure you're not using authentication.

Loren Johnson said on 08 Jul 2008:

As far as I can tell it's working now with:

gem install mailtrap

However "gem install mapshovel" does seem to be depreciated with the merge of the two.

Cheers,

Loren

Macky said on 29 Jul 2008:

Great idea! But it doesn't work on Windows - something about the Daemon gem not supporting the 'fork' function. Any ideas?




Gwyn Morfey — facebookflickrtumblr — London UK