Prevent unnecessary automated back-and-forth when sending noreply-emails

Posted . Visible to the public. Repeats.

When you send automated emails from a noreply@-address, and the recipient has an out of office enabled, the autoreply bounces and they get an additional email with an error message.

To prevent the recipient's auto-response and the following error message you can set the email header Auto-Submitted: auto-generated in your mailer, for example like this:

class NoReplyMailer < ApplicationMailer
  default from: 'noreply@yourapp.com', 'Auto-Submitted' => 'auto-generated'
end  
Paul Demel
Last edit
Henning Koch
Keywords
out, of, office, abwesenheitsnotiz, bounce
License
Source code in this card is licensed under the MIT License.
Posted by Paul Demel to makandra dev (2025-04-10 16:22)