Ruchita Sirondiya

Ruchita Sirondiya

  • 2.1k
  • 50
  • 4.4k

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("xxx@xx.com"));  
  3. msg.Bcc.Add(new MailAddress("xxx@xx.com"));  
  4. msg.From = new MailAddress("xxx@xx.com""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("xx@xx.com""XXX");  
  11. client.Port = 587;  
  12. client.EnableSsl = true;  
  13. client.Send(msg);  
please give a solution ..

Answers (4)