Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get rid of - System.Net.Mail.SmtpFailedRecipientException 1

Status
Not open for further replies.

MeonR

Programmer
Aug 16, 2002
97
US
Hello All, I have a winforms app that uses System.Net.Mail to send an e-mail message. When I run this it throws:

System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Unable to relay

I believe this is caused by Exchange which will not allow relaying. At first I thought the way around this was to use the following:

NetworkCredential nc = new NetworkCredential("uname", "password");
sc.DeliveryMethod = SmtpDeliveryMethod.Network; sc.UseDefaultCredentials = true;
sc.Credentials = nc;

This does not work. My question is; how do I get around this with changing the settings in Exchange to allow relaying?

Thanks


"The beatings will continue until morale improves
 
if this is an Exchange issue then it's not related to C# (the relay would fail no matter what language). check with an infrastructure forum.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top