Ruchita Sirondiya

Ruchita Sirondiya

  • NA
  • 50
  • 5.6k

Emails not sending from smtp.zoho.com in c#

Apr 4 2019 6:19 AM
I am using ZOHO mail server for sending mails through my application. But it gives following error -
 
"TheSMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required."
 
my code -
  1. MailMessage msg = new MailMessage();  
  2. msg.To.Add(new MailAddress("[email protected]"));  
  3. msg.Bcc.Add(new MailAddress("[email protected]"));  
  4. msg.From = new MailAddress("[email protected]""Test mail");  
  5. msg.Subject = "send mail";  
  6. msg.Body = "test MAIL....";  
  7. msg.IsBodyHtml = true;  
  8. SmtpClient client = new SmtpClient();  
  9. client.Host = "smtp.zoho.com";  
  10. client.Credentials = new System.Net.NetworkCredential("[email protected]""XXX");  
  11. client.Port = 587;  
  12. client.EnableSsl = true;  
  13. client.Send(msg);  
please give a solution ..

Answers (4)