如何在 Ruby on Rails 中发送带有回执的电子邮件?
我必须发送带有回执(又名“回执确认”)的自动电子邮件,以确认收件人已实际收到并阅读了电子邮件。确认是发送到指定地址(电子邮件标题中给出的“Disposition-Notification-To”地址)的简单电子邮件。
你知道是否有一种简单的方法可以使用Rails(ActionMailer)来做到这一点?或者也许使用 Ruby(TMail、Net/SMTP)?
预先感谢您的帮助。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在邮件程序 def 块中设置标头,如下所示:
请注意,这些标头会在某些(但不是所有)电子邮件客户端中触发对话。此外,并不能保证收件人确实已阅读并理解电子邮件。
You set your headers in your mailer def block like so:
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.