Action Mailer: All mail comes from MAILER DAEMON
20 Jun, 2007
1 minute read

Today I was trying to send mail from my Rails application through Action Mailer. This is quite simple, but I wanted to use a custom from-address. So, I create a setup_email method in my UserNotifier class that sets some defaults for every email sent out:

class UserNotifier < ActionMailer::Base
    def setup_email(user)
      @recipients  = "#{}"
      @from        = "My Application <>">

May you spotted the problem already, but I didn’t. All the mail sent came from “MAILER DAEMON”.


The problem was that @from didn’t contain a properly formated from-address. It is missing the closing >, and so my email server ignores it.

If you have this issue, double check the from address, and make sure it’s valid! Cheers.

If you're seeing this message you've probably enabled some form of adblocker. I respect that.

I use this space to show recommended books on in relation to the post you just read. This generates a small income that allows me to buy a book every now and then.