Ramco Ramco

Ramco Ramco

  • 443
  • 3.4k
  • 526.8k

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)