Ramco Ramco

Ramco Ramco

  • 439
  • 3.4k
  • 544.6k

Error-Message = "The SMTP server requires a secure connection

Oct 6 2022 11:37 AM

Hi

  I am getting below error - Message = "The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Authentication Required. Learn more at"

Email.Body = BodyStr;

Email.BodyEncoding = Encoding.UTF8;
Email.IsBodyHtml = true;
Email.Priority = MailPriority.Normal;
SmtpClient sc = new SmtpClient(Result.SMTPHost, Convert.ToInt32(Result.SMTPPort));
sc.Credentials = new System.Net.NetworkCredential(Result.Email, "test");

sc.UseDefaultCredentials = false;
sc.EnableSsl = Convert.ToBoolean(Result.EnableSsl);

sc.Send(Email);

Thanks


Answers (8)