Ahmad Awais

NAVIGATE


SHARE


Generate Gmail App Password to Send emails with 2FA Two Factor Authenticated Accounts

Ahmad AwaisAhmad Awais

If you have 2FA two-factor authentication enabled for a Gmail account, you cannot use it as an alias to send emails by setting up the SMTP settings on Gmail. For that, you need to generate an App Password and use it in place of your actual password when setting up the SMTP details.

How to Generate Gmail App Passwords#

  1. Login to your Gmail account
  2. Navigate to the Google AppPasswords setting page https://security.google.com/settings/security/apppasswords
  3. In the select app choose Other (custom name)
  4. Give it an arbitrary name and press generate
  5. This will give you 16 characters tokenApp passwords let you sign in to your Google Account from apps on devices that don't support 2-Step Verification. You'll only need to enter it once so you don't need to remember it.

You can now use this token as your password in combination with your Gmail account and two-factor authentication will not be required.

No more failing Gmail emails due to 2FA#

Here’s how I set it up in Gmail.

Gmail Alias

That password is where you use the app password we generated above.

Peace! ✌️

Creator of CHAI.new — vibe code ai agents · Founder & CEO of Langbase.com — The most powerful serverless AI agents developer platform to build, deploy, and scale AI agents with tools and memory · Check out the State of AI Agents.

Ex VP DevTools & DevRel Eng. Rapid · Google Developers Advisory Board (gDAB) founding member. 🧑‍💻 AI/ML/DevTools Angel InvestorAI/ML Advisory Board San Francisco, DevNetwork

🎩 Award-winning Open Source Engineer & Dev Advocate 🦊 Google Developers Expert Web DevRel 🚀 NASA Mars Ingenuity Helicopter mission code contributor 🏆 8th GitHub Stars Award recipient with 5x GitHub Stars Award (Listed as GitHub's #1 JavaScript trending developer).

🌳 Node.js foundation Community Committee Outreach Lead, Member Linux Foundation, OpenAPI Business Governing Board, and DigitalOcean Navigator. 📟 Teaching thousands of developers Node.js CLI Automation and VSCode.pro course. Over 142 million views, 24 yrs Blogging, 108K developers learning, 200+ FOSS.

✌️ Author of various open-source dev-tools and software libraries utilized by millions of developers worldwide WordPress Core Developer 📣 TEDx Speaker with 100+ international talks.

As quoted by: Satya Nadella · CEO of Microsoft — Awais is an awesome example for developers.
💜 Loves his wife (Maedah) ❯ Read more about Ahmad Awais.

👋… Awais is mostly active on 𝕏 @MrAhmadAwais

📨

Developers Takeaway

Stay ahead in the web dev community with Ahmad's expert insights on open-source, developer relations, dev-tools, and side-hustles. Insider-email-only-content. Don't miss out - subscirbe for a dose of professional advice and a dash of humor. No spam, pinky-promise!

✨ 172,438 Developers Already Subscribed
Comments 0
There are currently no comments.