What you need for Gmail SMTP
Gmail's SMTP server requires two pieces of information: your full Gmail address (the username) and a password. However, Gmail does not let you use your regular Gmail password for SMTP connections to third-party programs like email clients or scheduling tools. Instead, you must create a separate app password — a 16-character code that works only for that specific program.
This two-step process exists because Gmail blocks less find connection methods by default. The app password bypasses that block for programs you trust, while keeping your main Gmail password safe.
Key Takeaways
- Your Gmail SMTP username is always your complete Gmail address, including @gmail.com.
- You cannot use your regular Gmail password for SMTP; you must create an app password instead.
- App passwords only work if you have two-step verification turned on in your Google Account settings.
- The app password appears only once when you create it, so copy it when ready into the program that needs it.
- Gmail's SMTP server address is smtp.gmail.com, and the port is usually 587 with TLS encryption.
Turn on two-step verification first
Before you can create an app password, your Google Account must have two-step verification enabled. This is a security requirement Google enforces — without it, the app password option will not appear.
Go to myaccount.google.com and sign in. Click "Security" in the left menu. Scroll down to "How you sign in to Google" and look for "2-Step Verification." If it says "Off," click it and follow Google's steps to turn it on. You will need access to your phone to receive a verification code. Once two-step verification is active, you can create app passwords.
Create your app password
Return to myaccount.google.com and click "Security" again. Scroll down to "How you sign in to Google" and this time you will see "App passwords" appear below "2-Step Verification." Click "App passwords."
Google will ask you to select what type of app you are setting up. Choose "Mail" from the first dropdown and "Windows Computer," "Mac," "iPhone," or "Android" from the second, depending on what device or program you are using. Then click "Generate."
Google will display a 16-character password in yellow text. This password appears only once. Copy it when ready — do not close this page until you have pasted it into the program that needs it. If you close the page without copying, you will have to delete this app password and create a new one.
Your SMTP username and password
SMTP Username: Your complete Gmail address. If your email is jane.smith@gmail.com, that is your username. Do not remove the @gmail.com part.
SMTP Password: The 16-character app password you just generated. It will look something like "abcd efgh ijkl mnop" (with spaces). Some programs ask you to remove the spaces; check the program's documentation if you are unsure.
SMTP Server: smtp.gmail.com
SMTP Port: 587 (with TLS encryption) or 465 (with SSL encryption). Most programs default to 587, which works for Gmail.
Paste the password into your program
Open the program or service that needs your Gmail SMTP details — this might be an email client like Outlook or Thunderbird, a scheduling tool, a backup service, or a web form. Look for settings labeled "SMTP," "Outgoing Mail," "Mail Server," or "Email Configuration."
Enter your Gmail address as the username and paste the 16-character app password into the password field. Do not type it manually; pasting reduces the chance of errors. Leave the SMTP server as smtp.gmail.com and the port as 587 unless the program or its help documentation tells you otherwise.
Most programs will test the connection when ready. If the test fails, double-check that you pasted the entire 16-character password with no extra spaces at the beginning or end.
What to do if the app password does not work
If you see an error after entering the app password, the most common cause is that two-step verification is not actually on. Return to myaccount.google.com, click "Security," and confirm that "2-Step Verification" shows "On." If it shows "Off," turn it on and wait a few minutes before trying the app password again.
The second most common issue is a typo or extra space in the password. Go back to myaccount.google.com, click "Security," then "App passwords," and delete the password you created. Create a new one and copy it again, this time pasting it directly into the program without typing any part of it manually.
If the program still will not connect, check whether it is asking for TLS or SSL encryption. Gmail works with both, but the port changes: use 587 for TLS or 465 for SSL. Your program's settings or help section will tell you which one it expects.
Managing multiple app passwords
You can create a separate app password for each program or device that needs one. This is actually safer than reusing the same password everywhere, because if one program is compromised, you can delete just that app password without affecting the others.
To see all your app passwords, go to myaccount.google.com, click "Security," then "App passwords." You will see a list of every app password you have created, labeled by device or program type. You can delete any of them by clicking the trash icon next to it. Deleting an app password when ready stops that program from connecting to Gmail.
Frequently Asked Questions
Can I use my regular Gmail password for SMTP instead of an app password?
No. Gmail blocks regular passwords from SMTP connections for security reasons. You must use an app password, which only works for SMTP and cannot be used to sign into your Gmail account directly. This protects your main password even if the third-party program is compromised.
What happens if I lose or forget the app password?
You cannot retrieve it — Google shows it only once when you create it. If you forget it, go to myaccount.google.com, click "Security," then "App passwords," find the password you created, and click the trash icon to delete it. Then create a new one and copy it when ready.
Do I need a different app password for each device?
You do not have to, but it is safer to create one per device or program. That way, if one device is lost or a program is compromised, you can delete just that app password without affecting your other connections. Google lets you create as many as you need.
Why does Google require two-step verification before I can create an app password?
Two-step verification proves you own the account and have access to your phone or security key. This prevents someone who has guessed your password from creating app passwords to access your email through other programs. It is an extra security layer.
Will the app password stop working if I turn off two-step verification?
Yes. If you disable two-step verification, all your app passwords stop working when ready. The program will no longer be able to connect to Gmail. To use SMTP again, you would have to turn two-step verification back on and create new app passwords.