none
SMTPClient - Mailbox unavailable RRS feed

  • Question

  • I am getting an error trying to send and an email via my Hotmail account. This is my code. Advice appreciated on resolution.

    Tha

            {
    			MailAddress to = new MailAddress("*****@vtext.com");
    			MailAddress from = new MailAddress("myaddress@hotmail.com");
    			MailMessage message = new MailMessage(from, to);
    			message.Subject = "Using the new SMTP client.";
    			message.Body = @"Using this new feature, you can send an e-mail message from an application very easily.";
    			// Use the application or machine configuration to get the  
    			// host, port, and credentials.
    			SmtpClient client = new SmtpClient("smtp.live.com");
                client.Port = 587;
                client.UseDefaultCredentials = false;
                client.DeliveryMethod = SmtpDeliveryMethod.Network;
                client.Credentials = new System.Net.NetworkCredential("myaddress@hotmail.com", "password");
                client.EnableSsl = true;
    
    
          try {
    			  client.Send(message);
    			}
    			catch (Exception ex) {
                    MessageBox.Show("Exception caught",
                          ex.ToString());
    		       

    nks - Dan

    Thursday, July 23, 2015 7:57 PM

Answers

  • I have tested your code and it is working without any problem:

    - Try changing your hotmail account setting on your account page.

    Go to your account settings. Click Recent Activity and there click this was me button. 


    • Proposed as answer by Kristin XieModerator Friday, July 24, 2015 8:19 AM
    • Marked as answer by DDL19 Friday, July 24, 2015 4:34 PM
    Thursday, July 23, 2015 9:44 PM