开发者

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

开发者 https://www.devze.com 2022-12-22 05:29 出处:网络
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 si

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开发者_如何学C-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.


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

headers['Return-Receipt-To'] = 'email@example.com'
headers['Disposition-Notification-To'] = 'email@example.com'
headers['X-Confirm-Reading-To'] = 'email@example.com'

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号