Two-factor authentication provides a higher level of assurance than authentication methods that depend only on one factor – password or passcode. 2FA methods rely on users providing a password/passcode as well as a second factor, usually either a security token or a biometric factor like a fingerprint.
In Mailkit, the first factor is the username and password, the second is the One-Time Password (OTP). By default, this is sent by email when you log in to the address that was assigned to the username when it was created.
You can also use authentication apps for 2FA. This method of authentication is significantly more secure – if an attacker gains access to your email, they can often gain access to other services. In order to use an app for two-factor authentication, you must first install the app on your mobile phone, for example, you can use Google Authenticator (available for download on Google Play or in the App Store).
How to activate 2FA in the application?
1) Log in to your account with your username and password and enter the OTP that you will receive via email.
2) In the upper right menu, click on the avatar icon to the left of your login name and select "Enable 2-factor authentication".

3) Enter the password for your account and click on the "Enable 2FA" button.

4) Open your OTP authentication app (eg. Google Authenticator) on your mobile phone and scan the displayed QR code. After loading it into the application a time-limited OTP code will be generated. To activate 2FA, it is necessary to enter this code and verify that everything has been set up correctly.

5) After verifying the settings, you will be logged out of Mailkit and you will need to log in again, this time using 2FA via the application.

Entering the OTP code from the authentication application will be required each time you log in to Mailkit.
If you check the checkbox for “Remember me on this device” during authentication, you will be prompted to authenticate on that device once every 30 days. If you log in to your account on a new device, you will always be prompted to enter the OTP code.