Flackou
Flackou

Reputation: 3671

How to send emails with return-receipts in Ruby on Rails?

I have to send automatic emails with Return Receipt (aka "acknowledgement of receipt"), to have the confirmation that the receiver have actually received and read the email. The confirmation is a simple email sent to a specified address (the "Disposition-Notification-To" address, given in the email header).

Do you know if there is an easy way to do that with Rails (ActionMailer)? or with Ruby perhaps (TMail, Net/SMTP)?

Thanks in advance for your help.

Upvotes: 2

Views: 1265

Answers (1)

Andreas Wagner
Andreas Wagner

Reputation: 11

You set your headers in your mailer def block like so:

headers['Return-Receipt-To'] = '[email protected]'
headers['Disposition-Notification-To'] = '[email protected]'
headers['X-Confirm-Reading-To'] = '[email protected]'

Note that these trigger a dialogue in some, but not all email clients. Also, it is not a guarantee that the receiver actually has read and understood the email.

Upvotes: 0

Related Questions