In this article I will explain with an example, how to resolve the following error while sending email using MailKit in .Net.
MailKit.Net.Smtp.SmtpCommandException: Authentication failed.
Error
The following error occurs when you try to send email with MailKit using credentials in your .Net application.
Authentication failed
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: MailKit.Net.Smtp.SmtpCommandException: Authentication failed.
Solution