惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Recent Announcements
Recent Announcements
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
博客园_首页
IT之家
IT之家
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
大猫的无限游戏
大猫的无限游戏
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 司徒正美
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
Jina AI
Jina AI
月光博客
月光博客
小众软件
小众软件
S
SegmentFault 最新的问题
量子位
阮一峰的网络日志
阮一峰的网络日志
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Sending email from alias via Gmail
Ryan Carter · 2026-04-29 · via DEV Community

Ryan Carter

To send email from an alias address through your Gmail account, generate a Google App Password, then add the alias under Settings → Accounts and Import → Send mail as with smtp.gmail.com:587 as the SMTP server and the App Password (not your normal Gmail password) as the credential. The alias has to already forward to your Gmail, and your account needs 2-Step Verification enabled.

Prerequisites: The alias address is a forwarder pointing to your Gmail. You need 2-Step Verification enabled on your Google account.

  1. Go to myaccount.google.com/apppasswords, create an App Password, and copy the 16-character code without spaces. You must have two-factor auth turned on.
  2. In Gmail: Settings → See all settings → Accounts and Import → "Send mail as" → Add another email address
  3. Enter the alias name (e.g. Ryan Carter, however you want it to show in the person's inbox) and alias email address (e.g. ryan@someplace.com), click Next Step
  4. Fill in the SMTP dialog:
    • Server: smtp.gmail.com
    • Port: 587
    • Username: your real Gmail address (e.g. ryan1234@gmail.com)
    • Password: the App Password (no spaces, NOT your regular password)
    • Security: TLS (don't need to select it usually, it is by default)
  5. Click Add Account — Gmail sends a verification email to your alias, which forwards it to your Gmail inbox
  6. Click the confirmation link in that email

Done — the alias will now appear in the From dropdown when composing.

Turning on 2-Step Verification:

Go to myaccount.google.com/security → scroll down to "How you sign in to Google" → click "2-Step Verification" → follow the prompts.

If you use Google Workspace:

Yes, it works the same way with one caveat — your Workspace admin has to allow App Passwords. If the App Passwords option doesn't appear at myaccount.google.com/apppasswords, it means the admin has it disabled. They'd need to go to the Admin Console → Security → Authentication → and enable "Allow users to manage their own app passwords."
Also in Workspace there's an extra step: the admin needs to enable "Allow users to send mail through an external SMTP server" under Apps → Google Workspace → Gmail → Advanced settings. Otherwise the SMTP relay gets blocked.

FAQ

Why do I have to use an App Password instead of my regular Gmail password?

Google blocks third-party access (including SMTP) using your normal account password by default — that's what 2-Step Verification is for. App Passwords are 16-character credentials scoped to a single app and revocable from your Google account, so they're safer than handing your real password to an SMTP client.

Can I do this without enabling 2-Step Verification?

No. App Passwords only exist on accounts with 2-Step Verification turned on. The "less secure app access" toggle that used to allow this was deprecated by Google in 2022.

Will recipients see my real Gmail address anywhere?

No — once the alias is verified, mail sent from it shows only the alias address in the From field. Recipients can still inspect the raw message headers and see Gmail's servers in the trace, but your real Gmail address is not exposed in the From, Reply-To, or visible headers.

What if I want replies to come back to my real Gmail and not the alias?

That's the default if your alias is a forwarder pointing to your Gmail — replies go to the alias and get forwarded back. If you want replies to bypass the alias and hit your Gmail directly, set "Reply-To" to your real Gmail address when composing, or configure it on the Send-mail-as entry.

Can I send from multiple aliases?

Yes — repeat the same setup for each alias. Each one becomes a separate option in the From dropdown when composing. You can also pick a default From address per recipient under "When replying to a message."