Back to tutorials
Tutorial

How To Configure and access Webmail In Gmail (2026): Send & Receive Your Domain Email in One Inbox

How To Configure and access Webmail In Gmail in 2026: add IMAP/SMTP, fix auth errors, and send as your domain with SPF/DKIM/DMARC.

By Anurag Singh
Updated on May 03, 2026
Category: Tutorial
Share article
How To Configure and access Webmail In Gmail (2026): Send & Receive Your Domain Email in One Inbox

Most “Gmail + business email” setups fail for boring reasons: a wrong port, a missing DNS record, or Gmail sending from the wrong identity. This tutorial shows How To Configure and access Webmail In Gmail in 2026. You’ll read your domain mailbox in Gmail and reply from your real address without torching deliverability.

You’ll configure two separate pieces:

  • Receiving (IMAP/POP): Gmail pulls mail from your mailbox so messages show up in Gmail.
  • Sending (SMTP “Send mail as”): Gmail sends through your mail server so recipients see you@yourdomain.com, not a Gmail address (and no weird “on behalf of”).

This guide works whether your mailbox lives on cPanel/WHM, DirectAdmin, Plesk, or a mail server on a VPS.

If you run your own mail stack, stable DNS and correct reverse DNS matter. These settings affect both delivery and spam placement.

A HostMyCode VPS is a solid baseline if you want full control over SPF/DKIM/DMARC and outbound SMTP reputation.

Before you start: collect your mail settings (5 minutes)

Open your hosting panel’s email section (or your mail server docs) and grab:

  • Email address: you@yourdomain.com
  • Password (or an app password if your provider requires one)
  • IMAP server: typically mail.yourdomain.com or imap.yourdomain.com
  • IMAP port/security: usually 993 with SSL/TLS
  • SMTP server: often the same hostname as IMAP, e.g. mail.yourdomain.com
  • SMTP port/security: commonly 465 (SSL) or 587 (STARTTLS)

If you use cPanel, this is usually under Email Accounts → Connect Devices. Keep that page open.

You’ll reuse those exact values in Gmail.

Step 1 — Verify DNS is correct (MX, and optionally autodiscover)

If your domain points at the wrong mail host, Gmail may still connect. Mail delivery will be flaky, though.

Start by confirming your MX records.

  1. Check your MX records with a DNS lookup from your computer:
nslookup -type=mx yourdomain.com

You should see MX targets that match your provider (for example, mail.yourdomain.com or a hosted email service).

If you migrated recently, allow time for propagation.

Next time, lower TTL before making changes.

If you manage DNS yourself, keep it centralized. HostMyCode customers often keep domains and DNS in one place using HostMyCode Domains. That helps prevent split DNS mistakes (MX at one provider, SPF at another).

Optional but helpful: some clients use autodiscover-style records, but Gmail doesn’t depend on them.

If your mail host suggests autoconfig or autodiscover CNAMEs, you can add them for future compatibility.

Just don’t treat them as required for Gmail.

Step 2 — Decide how Gmail will receive your mail (IMAP sync vs POP fetch)

There are two practical ways to get domain email into Gmail:

  • IMAP (best for real sync): two-way behavior. Read/unread status and folders stay consistent. This is commonly done in the Gmail mobile app or a desktop client. Google’s web Gmail interface doesn’t reliably support adding an external IMAP mailbox for all account types.
  • POP3 (works in Gmail web UI): Gmail checks the mailbox on a schedule and imports messages. It’s one-way, can lag, and won’t mirror folders well.

If you mean “webmail in Gmail” as “I want everything in the Gmail website,” you’re usually looking for POP fetch + SMTP send-as.

If you want fast updates and proper folders on your phone, use IMAP in the Gmail mobile app (or IMAP in a desktop client).

Step 3 — Configure receiving mail in Gmail web (POP3 fetch)

This is the most reliable way to read your domain mailbox inside Gmail on the web.

  1. Sign in to Gmail on the web.
  2. Go to Settings → See all settings.
  3. Open the tab Accounts and Import.
  4. Under Check mail from other accounts, click Add a mail account.
  5. Enter your full email address (e.g. you@yourdomain.com).
  6. Select Import emails from my other account (POP3).

Enter your POP settings. These are the most common working values:

  • Username: your full email address (unless your host says otherwise)
  • Password: your mailbox password
  • POP Server: mail.yourdomain.com
  • Port: 995
  • Always use a secure connection (SSL): enabled

Then choose the behavior you want:

  • Leave a copy on the server: turn this on if you still plan to use webmail (Roundcube, RainLoop, etc.) or another client.
  • Label incoming messages: do this. Use a label like Work or Support so the imported mail is easy to filter.
  • Archive incoming messages: optional. Useful if you want labels without cluttering your main inbox.

Quick diagnostic if it fails:

  • Use the server name exactly as your host provides it. Some hosts require server123.hostingcompany.tld instead of mail.yourdomain.com.
  • Confirm POP is enabled for the mailbox in your control panel.
  • Verify the server supports TLS on port 995.

Step 4 — Configure sending mail as your domain (SMTP in Gmail)

Receiving mail is only half the setup.

If you reply before configuring SMTP, Gmail may send from your Gmail address or add confusing headers.

Fix that by sending through your domain’s SMTP server.

  1. In Gmail web, go to Settings → See all settings → Accounts and Import.
  2. Under Send mail as, click Add another email address.
  3. Name: the display name recipients should see.
  4. Email address: you@yourdomain.com
  5. Uncheck Treat as an alias if this is a separate identity you want to keep distinct (common for role accounts like support@). For one personal mailbox, leaving it checked is usually fine.
  6. Click Next Step.

Enter SMTP settings (typical):

  • SMTP Server: mail.yourdomain.com
  • Port: 587 (STARTTLS) or 465 (SSL)
  • Username: full email address (often required)
  • Password: mailbox password
  • Secured connection: choose TLS/STARTTLS for 587, or SSL for 465

Gmail will send a verification email to the mailbox.

If you just enabled POP fetching, give it a few minutes to show up in Gmail.

If you don’t want to wait, open webmail and copy the confirmation code from there.

Make it the default sender: back under Send mail as, click make default next to your domain address.

Then open Compose and confirm the “From” dropdown shows your domain.

Step 5 — Configure IMAP access for the Gmail mobile app (true sync option)

If you want instant updates and proper folder syncing, add the mailbox to the Gmail app using IMAP.

This is separate from Gmail web’s POP import.

  1. On Android or iOS, open the Gmail app.
  2. Go to Settings → Add account.
  3. Choose Other (not Google).
  4. Enter your email address and tap Manual setup.
  5. Select IMAP.

Use these typical IMAP settings:

  • IMAP server: mail.yourdomain.com
  • Port: 993
  • Security type: SSL/TLS
  • Username: full email address
  • Password: mailbox password

Then configure SMTP for outgoing mail in the app:

  • SMTP server: mail.yourdomain.com
  • Port: 587 with STARTTLS (common) or 465 SSL
  • Require sign-in: enabled

Got a certificate warning? That almost always means the TLS certificate doesn’t match the hostname you typed.

Use the hostname on the certificate (often the server’s FQDN), or install a certificate that matches your mail hostname.

Step 6 — Fix the three most common Gmail setup errors

These are the problems that burn time in “webmail in Gmail” setups.

Authentication failed (username/password rejected)

  • Use the full email address as the username, not just the part before @.
  • Reset the mailbox password in your hosting panel and try again.
  • If your provider requires app passwords or enforces mailbox security policies, generate an app password and use that.

Server denied POP3/IMAP access

  • Confirm POP/IMAP is enabled for the mailbox.
  • Verify ports are open on the server firewall: 993, 995, 587/465.

If you’re on a VPS, you can check listening ports:

sudo ss -tulpn | egrep ':(993|995|587|465)'

And test connectivity from another machine:

openssl s_client -connect mail.yourdomain.com:993 -servername mail.yourdomain.com
openssl s_client -connect mail.yourdomain.com:587 -starttls smtp

Gmail sends, but messages land in spam

This is almost always DNS and reputation, not a Gmail settings issue.

  • Publish SPF authorizing your sending server IP.
  • Enable and publish DKIM from your mail server/control panel.
  • Publish a DMARC policy (even p=none at first) so you can read reports.
  • Make sure rDNS (PTR) matches your sending hostname if you send mail from a VPS or dedicated server.

If you want a practical checklist you can follow line by line, use: VPS email deliverability checklist for 2026 (SPF, DKIM, DMARC, rDNS).

Step 7 — Recommended DNS records for Gmail-friendly sending (SPF, DKIM, DMARC)

If your domain email lives on your own server or a hosting control panel, these records do most of the heavy lifting for inbox placement.

The exact values depend on your provider, but the patterns stay the same.

SPF (TXT)

Example for a domain that sends mail only from its own server IP:

yourdomain.com.  TXT  "v=spf1 ip4:203.0.113.10 -all"

If your host recommends include: mechanisms, follow that guidance instead of hardcoding IPs.

Also: publish one SPF record only. Merge duplicates.

DKIM (TXT)

Generate DKIM in your mail server/control panel, then publish the TXT record under a selector such as:

default._domainkey.yourdomain.com.  TXT  "v=DKIM1; k=rsa; p=..."

DMARC (TXT)

Start in monitoring mode, then tighten the policy later:

_dmarc.yourdomain.com. TXT "v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com; adkim=s; aspf=s"

If you run mail on a VPS, keep server security and SMTP hygiene in view.

This pairs well with: VPS Email Server Security in 2026.

Step 8 — If you host mail on a VPS: confirm TLS and mailbox services

A lot of “Gmail can’t connect” reports come down to services not running or a certificate mismatch.

On Ubuntu 24.04-based stacks, Postfix (SMTP) and Dovecot (IMAP/POP) are common.

Check service status:

sudo systemctl status postfix
sudo systemctl status dovecot

Check logs while testing Gmail setup:

sudo journalctl -u postfix -f
sudo journalctl -u dovecot -f

If you’re building or rebuilding the server, use a known-good mail stack guide. It helps keep TLS, submission ports, and auth consistent.

This tutorial is a solid reference: Linux VPS mail server setup (Postfix + Dovecot) on Ubuntu 24.04.

Step 9 — Make webmail and Gmail coexist cleanly

You can keep using webmail (Roundcube, RainLoop, etc.) while Gmail also pulls mail.

The key is avoiding unexpected deletions or missing messages.

  • If you configured POP fetch in Gmail, enable Leave a copy of retrieved messages on the server.
  • In your webmail, avoid aggressive server-side cleanup rules until you trust the setup.
  • If you use IMAP in the Gmail app, you get true two-way sync. Delete in one place, and it deletes in the other—that’s normal.

For shared inboxes like support@, use a dedicated label and filters in Gmail.

Also be careful with “treat as alias” unless you intentionally want identities to blend.

Step 10 — Troubleshooting checklist (copy/paste friendly)

  • MX points correctly: nslookup -type=mx yourdomain.com
  • Correct ports: IMAP 993, POP 995, SMTP 587/465
  • TLS cert matches hostname: no “certificate doesn’t match” warnings
  • SMTP auth works: test with openssl s_client -starttls smtp and watch logs
  • SPF/DKIM/DMARC present: one SPF record only, DKIM enabled, DMARC published
  • PTR/rDNS set (VPS/dedicated): IP reverse record matches sending hostname

If you manage your own server, patch and harden it on a schedule.

A lot of mail outages come from simple OS drift.

This pairs well with: VPS maintenance checklist for 2026.

Summary: keep Gmail as the interface, keep your domain as the identity

You now have a practical setup: Gmail imports mail for reading, and sends through your domain SMTP so the “From” header stays clean.

If it breaks later, the usual culprits are DNS (SPF/DKIM/DMARC), a TLS hostname mismatch, or an outbound SMTP block.

If you’re hosting email alongside your sites and want predictable performance and control, start with a HostMyCode VPS.

If you don’t want to maintain mail services, updates, and deliverability tuning yourself, managed VPS hosting is the calmer option for production email and web workloads.

If your domain email setup keeps failing in Gmail, the cause is usually on the server side: missing TLS, blocked submission ports, or incomplete SPF/DKIM/DMARC. HostMyCode can put you on a clean foundation with a HostMyCode VPS, or take over the sysadmin work with managed VPS hosting so your mail config stays stable.

FAQ

Can I access my hosting webmail (Roundcube) inside Gmail?

Gmail can’t embed Roundcube as a UI.

It can retrieve mail (POP) and send mail (SMTP) using the same mailbox credentials.

In practice, that’s what people mean by “webmail in Gmail”: Gmail becomes the interface.

Should I use port 465 or 587 for SMTP from Gmail?

Use what your mail host documents. In 2026, 587 with STARTTLS is the most common submission port.

Use 465 if your provider explicitly supports SMTP over SSL and it’s reliable on your server.

Why does Gmail say “via yourdomain.com” or “on behalf of”?

That usually means Gmail isn’t sending through your domain SMTP, or the “Send mail as” identity wasn’t verified correctly.

Re-check the SMTP values and complete the confirmation step.

Will POP fetching delete messages from my server?

Only if you leave “Leave a copy of retrieved message on the server” unchecked.

If you want webmail (or another client) to keep working, enable it.

Do I need SPF/DKIM/DMARC if Gmail is sending the email?

If Gmail sends through your domain’s SMTP server, then yes. Those DNS records still matter because your server is the sender of record.

They also strongly influence inbox placement.