Hi i am trying to send an email via C# and having a little trouble with error code:
Mailbox unavailable. The server response was: 5.7.1 Unable to relay for =@p0
I have had a good look round and it seems it is a problem with authentication... So i set up a user called PurchaseOrder on our exchange server and enabled the account. but i am still getting this error
SmtpClient smtp = new SmtpClient("10.0.0.1");
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential("PurchaseOrder", "qwer123!");
try
{
smtp.Send(Email);
}
catch (Exception e)
{
System.Windows.Forms.MessageBox.Show("Email not sent correctly: {0}", e.ToString());
}
Anyone got any ideas?
Thanks