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: 5.7.9 Application-specific password required.
Note: For more details on how to send Email using MailKit, please refer my article Send Email using MailKit in ASP.Net WebForms.
 
 
Error
The following error occurs when you try to send email with MailKit using credentials in your .Net application.
5.7.9 Application-specific password required. For more information, go to
5.7.9  https://support.google.com/mail/?p=InvalidSecondFactor x28-20020a056a00189c00b006d503ee309bsm2669303pfh.121 - gsmtp
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: 5.7.9 Application-specific password required. For more information, go to
5.7.9  https://support.google.com/mail/?p=InvalidSecondFactor x28-20020a056a00189c00b006d503ee309bsm2669303pfh.121 – gsmtp
 
.Net MailKit Error: 5.7.9 Application-specific password required
 
 
Solution
Application Specific Password means the password generated for your App in Google Account. You will need to use App Password of your Google Account and then use that password in your MailKit Email application.
.Net MailKit Error: 5.7.9 Application-specific password required
 
Note: For more details on how to generate App Password, please refer my article Setup Two Step Authentication in Google Account.