System.Net.Mail.SmtpClient

G

Guest

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?

Thanks.
 
M

Mike Lowery

V said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top