I am struggling with attempting to send email from a .NET application.
{"Mailbox unavailable. The server response was: 5.7.3 Requested action aborted; user not authenticated"} System.Exception {System.Net.Mail.SmtpException}
Now this would seem to indicate (from my limited understanding at least) that there is something wrong with my credentials, that is, my email address and password.
Here is the problem. I login into my Microsoft account using a Yahoo email address. This is the address I supplied as part of the credentials. If this is not correct, where can I find the appropriate email address, or what else might I be missing?
try
{
SmtpClient smtpClient = new SmtpClient("smtp-mail.outlook.com", 587);
smtpClient.EnableSsl = true;
smtpClient.Credentials = new System.Net.NetworkCredential("kelly*******@yahoo.com", "myMicrosoftPassword");
smtpClient.UseDefaultCredentials = true;
smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
MailMessage mail = new MailMessage();
//Setting From , To and CC
mail.From = new MailAddress("kelly*******@yahoo.com", "Kelly");
mail.To.Add(new MailAddress("[email protected]"));
smtpClient.Send(mail);
}
catch (Exception ex)
{
Console.Write(ex.Message);
}
Thanks!