回答
將MailMessage的DeliveryNotificationOptions屬性設置爲
System.Net.Mail.DeliveryNotificationOptions.OnSuccess
;
或嘗試:
static void ReadReceipts()
{
//create the mail message
MailMessage mail = new MailMessage();
//set the addresses
mail.From = new MailAddress("[email protected]");
mail.To.Add("[email protected]");
//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";
//To request a read receipt, we need add a custom header named 'Disposition-Notification-To'
//in this example, read receipts will go back to '[email protected]'
//it's important to note that read receipts will only be sent by those mail clients that
//a) support them
//and
//b)have them enabled.
mail.Headers.Add("Disposition-Notification-To", "<[email protected]>");
//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}
知道某人是否收到電子郵件的唯一方法是讓他們以某種方式通知您(閱讀收件人或類似內容)。
這就是爲什麼所有的電子郵件確認方案總是需要點擊鏈接以確認它是您的電子郵件。
這是確定的,但有時會同時註冊,如果用戶沒有收到確認電子郵件(以鏈接激活帳戶的電子郵件),我們怎麼能知道這件事,因爲我沒有從SmtpClient類方法中得到任何異常。 – gaurav 2010-09-17 10:33:49
您無法知道他們是否收到了郵件,即使郵件從您的服務器發送出去,它可能會在途中丟失(包括他的電子郵件提供商可能因某種原因已將您的電子郵件提供商列入黑名單,並自動刪除所有電子郵件)。我建議在用戶註冊之後,如果您在x分鐘內沒有收到郵件,請在郵件中顯示「'」,請檢查您的垃圾郵件文件夾,或嘗試重新發送郵件,或重新發送郵件至另一個電子郵件地址「'。 – 2010-09-17 10:40:02
- 1. 有沒有辦法知道用戶是否打開郵件?
- 2. 有沒有辦法知道ExecutorService是否成功結束?
- 3. 有沒有什麼辦法可以知道Outlook 2010是否有新的C#電子郵件#
- 4. 有沒有辦法知道用戶是否發送了短信?
- 5. 如何知道我是否使用System.Net.Mail成功發送電子郵件
- 6. 有沒有辦法知道timerTask是否已完成?
- 7. 有沒有辦法知道文件名是否是Excel格式?
- 8. 有沒有辦法判斷電子郵件是否有OneDrive附件?
- 9. 有沒有辦法用電子郵件gem來測試電子郵件連接?
- 10. 有沒有辦法阻止MFMailComposeViewController發送電子郵件?
- 11. 有沒有辦法從mysql發送電子郵件
- 12. iPhone - 有沒有辦法知道引用是否(仍然)有效?
- 13. 有沒有辦法知道誰是「setNeedsDisplay」的發件人?
- 14. 我如何知道是否有人打開了電子郵件?
- 15. 有沒有辦法知道Data Saver是否啓用?
- 16. 有沒有辦法知道異常是否被禁用?
- 17. 有沒有辦法知道一個對象的C#方法是否被調用?
- 18. 有沒有辦法知道手機是否有通話?
- 19. 有沒有辦法檢測Outlook郵件是否沒有附件?
- 20. 有沒有辦法確定電子郵件是否到達目的地?
- 21. 有沒有辦法測試一個電子郵件地址是否存在而不發送測試郵件?
- 22. Swift_Mailer認證併發送成功,但沒有電子郵件
- 23. phpmailer成功,但沒有發送電子郵件
- 24. ColdFusion電子郵件 - 是否有方法確認電子郵件已發送?
- 25. 有沒有辦法知道一行是否更新?
- 26. 有沒有辦法知道Flash Player是否安裝了SWFObject?
- 27. 有沒有辦法知道rxjs websocket是否打開
- 28. 有沒有辦法知道HttpResponse是否在Https中?
- 29. 有沒有辦法知道是否已經創建了IWin32Window?
- 30. 有沒有辦法知道$ http請求是否超時?
我可以設置多個DeliveryNotificationOptions嗎?謝謝。 – gaurav 2010-09-17 12:03:22
@gaurav - 沒有試過那個 – 2010-09-17 12:07:28
許多服務器 - 尤其是企業服務器 - 阻止傳送報告,因爲它們揭示了哪些電子郵件地址是有效的,因此可能導致垃圾郵件。 – 2010-09-17 12:32:55