bra*_*age 13 java email smtp email-confirmation
我正在编写一个程序,它会发送电子邮件,并想知道接收方何时收到我发给他的电子邮件.如何使用JavaMail API执行此操作?
如果我使用SMTPMessage,在设置通知选项后如何处理结果?
SMTPMessage smtpMsg = new SMTPMessage(msg);
smtpMsg.setNotifyOptions(SMTPMessage.NOTIFY_SUCCESS);
Run Code Online (Sandbox Code Playgroud)
Eri*_*son 21
There is no standard way of doing this that's accepted and honored across the board. I see that you have some options, though:
Add a header "Return-Receipt-To" with your e-mail address in the value. If the recipient of the e-mail has a client which honors this header, then a return receipt will be sent to you when the e-mail is opened. This is not reliable, mind you, as the user can always decide not to send the receipt, even if he has a client that supports it.
将图像添加到从服务器加载的电子邮件中,并在包含用户电子邮件地址的图像上放置参数.加载电子邮件时,图像将从您的服务器加载.编写一个收集电子邮件参数的脚本,然后发送一个空白图像.然而,这也是不可靠的,因为许多邮件客户端如果希望下载图像而提示用户,并且他们总是可以选择不这样做.此外,一些(主要是较旧的)电子邮件客户端不支持图像.
Perhaps the most reliable way is not to include the message in your e-mail at all. Include only a link to a website where the message can be read, and include their e-mail address or a unique code in the link. This way, you know exactly who read the message. Of course, this has the downside that people aren't actually getting the message in their inbox, and they also may choose not to go to the website to read it.
Ultimately, I think you're going to have to come up with a creative solution to solve this problem, unless you're happy getting spotty results.
| 归档时间: |
|
| 查看次数: |
26583 次 |
| 最近记录: |