I am receiving the following error:
// error: System.Net.Mail .SmtpException: The SMTP server requires a
secure connection or the client was not authenticated. The server
response was: 5.7.0 No AUTH command has been given.
How do I provide the Client Authentication with the code below.
private void SendEmail2()
{
/* create the email message */
MailMessage message = new mailMessage("jw ill@domain.com" ,
"test@domain.co m","Test email " +
DateTime.Today. ToString(),"bod y fo the message " );
/* create SMTP Client and add credentials */
SmtpClient smtpClient = new SmtpClient("smt p.domain.com");
/* Email with Authentication */
smtpClient.Cred entials = new NetworkCredenti al("jwill",
"abcdef");
smtpClient.UseD efaultCredentia ls = false;
/*Send the message */
smtpClient.Send (message);
// error: System.Net.Mail .SmtpException: The SMTP server requires a
secure connection or the client was not authenticated. The server
response was: 5.7.0 No AUTH command has been given.
}
// error: System.Net.Mail .SmtpException: The SMTP server requires a
secure connection or the client was not authenticated. The server
response was: 5.7.0 No AUTH command has been given.
How do I provide the Client Authentication with the code below.
private void SendEmail2()
{
/* create the email message */
MailMessage message = new mailMessage("jw ill@domain.com" ,
"test@domain.co m","Test email " +
DateTime.Today. ToString(),"bod y fo the message " );
/* create SMTP Client and add credentials */
SmtpClient smtpClient = new SmtpClient("smt p.domain.com");
/* Email with Authentication */
smtpClient.Cred entials = new NetworkCredenti al("jwill",
"abcdef");
smtpClient.UseD efaultCredentia ls = false;
/*Send the message */
smtpClient.Send (message);
// error: System.Net.Mail .SmtpException: The SMTP server requires a
secure connection or the client was not authenticated. The server
response was: 5.7.0 No AUTH command has been given.
}
Comment