如何确认邮件已送达? [英] How to confirm that mail has been delivered or not?

查看:272
本文介绍了如何确认邮件已送达?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是我的编码,请看一下

Below is my coding, just have a look at it

System.Net.Mail.MailMessage oMail = new System.Net.Mail.MailMessage();
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient();
oMail.From = new System.Net.Mail.MailAddress("one@gmail.com");
oMail.To.Add(TextBox1.Text.Trim());
oMail.Subject = "Subject*";
oMail.Body = "Body*";
oMail.IsBodyHtml = true;
smtp.Host = "smtp.sendgrid.net";
System.Net.NetworkCredential cred = new System.Net.NetworkCredential("myusername", "mypassword");
smtp.UseDefaultCredentials = false;
smtp.Credentials = cred;
smtp.Send(oMail);

在这里,我需要检查该邮件是否已送达.

Here I need to check whether that mail has been delivered or not.

推荐答案

您不能.由于您通常使用SMTP,因此无法确定传送是否成功.阅读SMTP规范.邮件在传递时被路由,所以:

You can't. Since you use SMTP, in general case, it's impossible to tell whether delivery succeeded or not. Read SMTP specification. Mail is routed while being delivered, so:

  1. 不能保证您致电smtp.Send()就会立即发送邮件.
  2. 由于SMTP已路由,因此无法确定路由上的某些节点不会因为传递到上行链路而失败.
  1. There's no guarantee your message is sent as soon as you call smtp.Send().
  2. Since SMTP is routed, you can't be sure that some node on the route won't fail with delivery to uplink.

这篇关于如何确认邮件已送达?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆