What is an app password?
An app password is a long random password that only works for one app or device, such as a WordPress plugin, a printer or a script. It gets around two-step verification for that one app, and you can revoke it without changing your main password.
If your SMTP login fails with 535 Authentication failed even though the password is right, you almost certainly need one.
Two-step verification first. Every provider below only shows the app password option once two-step verification (2FA) is turned on for the account.
Gmail and Google Workspace
- Turn on 2-Step Verification in your Google Account under Security.
- Open
myaccount.google.com/apppasswords. - Enter a name for the app (for example “Website contact form”) and click Create.
- Copy the 16-character password. Google only shows it once.
SMTP settings: smtp.gmail.com, port 587 with STARTTLS (or 465 with SSL/TLS), username is your full Gmail or Workspace address.
Option missing? App passwords aren’t available if 2-Step Verification uses only security keys, if the account is enrolled in Advanced Protection, or if a Workspace admin has turned the feature off.
Yahoo Mail
- Sign in and open Account Info → Account Security.
- Choose Generate app password (or Manage app passwords).
- Name the app, generate the password and copy it.
SMTP settings: smtp.mail.yahoo.com, port 465 with SSL/TLS or 587 with STARTTLS.
iCloud Mail
- Make sure two-factor authentication is on for your Apple Account.
- Sign in at
account.apple.comand open Sign-In and Security → App-Specific Passwords. - Create a password, give it a label and copy it.
SMTP settings: smtp.mail.me.com, port 587 with STARTTLS. Use your full iCloud email address as the username.
AOL Mail
- Open Account Info → Account Security.
- Click Generate app password, name the app and copy the password.
SMTP settings: smtp.aol.com, port 465 with SSL/TLS.
Zoho Mail
If two-factor authentication is on, open accounts.zoho.com → Security → App Passwords and generate one. Without two-factor authentication, your normal Zoho password works. Use the SMTP host for your data centre: smtp.zoho.com, smtp.zoho.eu or smtp.zoho.in.
Fastmail
Fastmail always requires an app password for SMTP. Go to Settings → Privacy & Security → App passwords, create one with SMTP access, and use smtp.fastmail.com on port 465.
Outlook.com and Microsoft 365
Microsoft works differently, and the rules have changed recently:
- Outlook.com, Hotmail and Live (personal accounts): since September 2024, SMTP only accepts OAuth 2.0 sign-in. Passwords and app passwords are rejected with
535 5.7.139 ... basic authentication is disabled. Use an app that offers “Sign in with Microsoft”, or send through a relay service. - Microsoft 365 (work and school): password-based SMTP still works if an admin enables Authenticated SMTP on the mailbox. From the end of December 2026 Microsoft switches it off by default; admins can turn it back on for now, and full removal is expected in the second half of 2027. Plan a move to OAuth 2.0 or a relay service.
Tips for using app passwords
- Create one app password per app or device, so you can revoke one without breaking the others.
- Paste it without spaces. Google shows it in four groups, but the spaces aren’t part of it.
- Changing your main password can revoke existing app passwords (Google does this). Create new ones afterwards.
- Store it like any other secret: in an environment variable or a secrets manager, not in code you commit.
Once you have the app password, confirm it works with the SMTP test.
Frequently asked questions
With two-step verification on, a password alone isn’t enough to sign in, and SMTP has no way to ask for the second step. Providers solve this with app passwords: a separate password for that one app.
2-Step Verification must be on. The option is also hidden when 2-Step Verification uses only security keys, when the account is in Advanced Protection, or when a Google Workspace admin has disabled app passwords.
Not for SMTP any more. Since September 2024 Microsoft only accepts OAuth 2.0 sign-in for SMTP on Outlook.com, Hotmail and Live accounts.
Usually not, but they are revoked if you delete them, and Google revokes them when you change your account password.