检测电子邮件是否发送到邮件列表
我的应用程序发送包含身份验证令牌的邮件。收到邮件的用户点击链接并被定向到网页。该应用程序认出了他。
问题是有时邮件会发送到邮件列表而不是个人地址。然后几个人进入该页面并覆盖彼此的操作。
我认为有两种方法可以解决此问题:
- 在发送邮件之前检测电子邮件地址是否为邮件列表,并
- 在电子邮件的链接中包含最终收件人地址。
2个中的任何一个都可能吗?
My application sends mails containing an authentication token. The user which receives the mail clicks on a link and is directed to a webpage. The app recognizes him.
The problem is that sometimes the mail is sent to a mailing list instead of a personal address. Then several people come on the page and override each others' actions.
There are 2 ways I think I could solve this :
- detect that the email address is a mailing list before I send the mail
- include the final recipient address in the link in the email.
Is any of the 2 possible ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不会。
收件人可以判断邮件是否来自邮件列表(如果该列表遵循正确的准则),但发件人不能。
发件人无法根据最终收件人动态修改电子邮件正文。
No.
The recipient can tell if the message came from a mailing list (if the list follows the right guidlines), but the sender can't.
There is no way for the sender to modify the body of an email dynamically based on the final recipient.
大卫的回答是正确的。不过,根据您的上下文,您可能会发现以下想法很有用:
您也许能够记录使用该令牌发送的每封电子邮件的点击次数,并且只需指定一个阈值。如果身份验证令牌的次数超过它,请将收件人标记为邮件列表并将其从将来的邮件中排除。
David's answer is correct. Though, depending on your context you may find the following idea useful:
You might be able to record the number of clicks per email sent out using that token and just specify a threshold. If the number of times the auth token exceeds it, flag the recipient as a mailing list and exclude them from future mailings.