Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Problem with Mailbox

$
0
0
Hi,
Exchange server is working fine in the server. with these codes
                    MailMessage message = new MailMessage();
                    message.From = new MailAddress("Administrator@my-friend.co");
                    message.To.Add("peterchen@gmail.com");
                    message.Subject = "test message";
                    message.Body = "This is a test e-mail message sent by an application. ";


                    SmtpClient client = new SmtpClient("my-friend.co", 587);
                    client.UseDefaultCredentials = false;
                    client.Credentials = new System.Net.NetworkCredential("Administrator@my-friend.co", "?????");
                    client.EnableSsl = true;
                    client.Send(message);
                    ...


I don't know why I get this exception and Stacktrace now.
Mailbox unavailable. The server response was: 5.7.1 Unable to relay   
at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception)

And how to ensure port 587 is correct for secure Email?

Many Thanks & Best Regards, Hua Min


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>