开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜