

Action Mailer: All mail comes from MAILER DAEMON
source link: https://www.devroom.io/2007/06/20/action-mailer-all-mail-comes-from-mailer-daemon/?utm_campaign=Feed%3A+ariejan+%28ariejan%7Cdevroom.io%29
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Action Mailer: All mail comes from MAILER DAEMON
Posted:
2007-06-20
- Last updated:
2019-06-05
Tagged general rubyonrails features ruby
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
protected
def setup_email(user)
@recipients = "#{user.email}"
@from = "My Application <[email protected]>">
end
end
May you spotted the problem already, but I didn’t. All the mail sent came from “MAILER DAEMON”.
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.
My site is free of ads and trackers. I record privacy-respecting usage statistics with Fathom.
Was this post helpful to you? Why not ☕ Buy me a coffee
Copyright © 1999-2020 Ariejan de Vroom <[email protected]>
Live now; make now always the most precious time. Now will never come again.
– Jean-Luc Picard
Recommend
-
80
README.md Log mailer
-
15
Asynchronous email deliveries using Resque and resque_action_mailer_backend If you have ever sent emails using ActionMailer during a user request you probably noticed that if the email sending fails or ta...
-
10
Accessing the current request object on your mailer templates to generate links A common issue with mailer templates is that as they’re not being called from a controller you can’t get your hands on the r...
-
21
-
16
Outsourcing mail and the mailer daemon blackhole trap Yesterday's post about bad Postfix settings reminded me of something else which used to create support tickets. It w...
-
9
Ineffective NO_ROOT_MAILER and Baron Samedit oss-sec mailing list archives By Date
-
12
Mutt mailer: Show Messages With Attachments A discussion on the Mutt-Users list a while back involved someone trying to
-
5
Friday, April 7, 2023 A new conference, new Action Mailer callbacks and more! Posted by Greg Hi, it’s Gre...
-
11
Friday, August 11, 2023 A new release, Action Mailer preview empty states, bugfixes and more! Posted by gregmolnar Hi, it’s
-
8
Friday, November 17, 2023 Action Mailer bug report template, Active Storage fixes and more! Posted by Greg Molnar Hi, it’s
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK