且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

电子邮件退回支持

更新时间:2023-12-04 13:23:10

在您的邮件服务程序中,可以使用异常捕获邮件失败
In your mail service program, the mail failure can be captured using exception
MailAddress from, to;
try
{
	MailMessage mailMsg = new MailMessage();
	.........
	SmtpClient smtpClient = new SmtpClient("mailserver", port);
	smtpClient.Send(mailMsg);
}
catch (IOException ex)
{
	MailMessage mailMsg = new MailMessage();
	to = from;
	.........
	smtpClient.Send(mailMsg);	
}



显然,退回邮件通知可以到达原始发件人.



Apparently, the bouncing mail notification can reach the originator.