|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
System.Net.Mail.SmtpClientI am using SmtpClient.Send method to send emails from a windows service
running under LoacalSystem credential. This program does not receive an exception when the Send method is called for a bogus email address. I am using my email address as FromAddress. The Host property is referencing a SMTP server on the network. I receive a delivery failure email in my Inbox. How can make it work so that I receive a SmtpFailedRecipientsException when the target email address is invalid? Thanks. "V" <V@discussions.microsoft.com> wrote in message I don't think you can. The error is generated by the recipients SMTP server, news:1B8EA9AB-7B78-4DC0-A078-08038C61DBC9@microsoft.com... >I am using SmtpClient.Send method to send emails from a windows service > running under LoacalSystem credential. This program does not receive an > exception when the Send method is called for a bogus email address. I am > using my email address as FromAddress. The Host property is referencing a > SMTP server on the network. I receive a delivery failure email in my Inbox. > How can make it work so that I receive a SmtpFailedRecipientsException when > the target email address is invalid? not yours. Thanks. That makes sense.
Show quote "Mike Lowery" wrote: > > "V" <V@discussions.microsoft.com> wrote in message > news:1B8EA9AB-7B78-4DC0-A078-08038C61DBC9@microsoft.com... > >I am using SmtpClient.Send method to send emails from a windows service > > running under LoacalSystem credential. This program does not receive an > > exception when the Send method is called for a bogus email address. I am > > using my email address as FromAddress. The Host property is referencing a > > SMTP server on the network. I receive a delivery failure email in my Inbox. > > How can make it work so that I receive a SmtpFailedRecipientsException when > > the target email address is invalid? > > I don't think you can. The error is generated by the recipients SMTP server, > not yours. > > > |
|||||||||||||||||||||||