How to Connect Google Workspace to WordPress via SMTP

Photo: Unsplash — free to use, no attribution required

How Google Workspace Email Works

Google Workspace email runs on the same infrastructure as consumer Gmail but adds business features: custom domain email addresses, administrative controls, advanced security, and compliance tools. When you send email from your Google Workspace account, it carries Google's sender reputation — one of the highest in the email ecosystem.

The email architecture involves several layers: DNS records direct incoming mail to Google's servers, authentication records (SPF, DKIM, DMARC) verify that outgoing mail is legitimate, and Google's internal systems handle spam filtering, virus scanning, and policy enforcement.

Configuration typically involves two phases: initial setup (domain verification, MX records, user creation) and optimization (authentication records, security policies, email routing rules). Getting the initial setup right ensures uninterrupted email delivery; optimization improves security and management over time.

Setting Up Your Domain

Start by signing up for Google Workspace at workspace.google.com. You will need to verify domain ownership — Google provides several methods including adding a TXT record to your DNS, uploading an HTML file to your website, or adding a meta tag to your homepage. The DNS TXT record method is the most reliable and commonly used.

Before changing MX records, lower your domain's MX record TTL (Time to Live) to 300 seconds (5 minutes) at least 24 hours in advance. This ensures that when you switch MX records to Google, the change propagates quickly across the internet, minimizing the window where email delivery is uncertain.

Create your user accounts in the Google Workspace Admin Console before switching MX records. This way, when incoming mail starts routing to Google, the mailboxes are already in place to receive it. Add all team members who need email access, set temporary passwords, and prepare welcome communications with login instructions.

Step-by-Step Setup Process

Sign into the Google Workspace Admin Console at admin.google.com. Navigate to Account → Domains → Manage Domains and begin the domain verification process. Add a TXT record with the provided verification string to your domain's DNS. Once Google confirms the record, your domain is verified.

Update your domain's MX records to route email to Google. Remove any existing MX records and add the following Google MX records: ASPMX.L.GOOGLE.COM (priority 1), ALT1.ASPMX.L.GOOGLE.COM (priority 5), ALT2.ASPMX.L.GOOGLE.COM (priority 5), ALT3.ASPMX.L.GOOGLE.COM (priority 10), ALT4.ASPMX.L.GOOGLE.COM (priority 10). These records ensure redundancy — if one server is unavailable, email is routed to alternates.

Configure SPF by adding this TXT record to your DNS: v=spf1 include:_spf.google.com ~all. This authorizes Google's mail servers to send email on behalf of your domain. For DKIM, go to Admin Console → Apps → Google Workspace → Gmail → Authenticate email, generate a DKIM key, and add the provided TXT record to your DNS.

For SMTP relay setup (used by applications, printers, and WordPress): go to Admin Console → Apps → Google Workspace → Gmail → Routing → SMTP relay service. Configure the allowed senders (by IP address or authenticated users), the permitted recipients, and the encryption requirements. The SMTP relay address is smtp-relay.gmail.com on port 587 with TLS.

Validating Email Delivery

Testing should cover multiple scenarios: send test emails to Gmail, Outlook, and Yahoo addresses to verify deliverability across major providers. Each provider has slightly different filtering criteria, so testing across all three catches issues that testing with just one might miss.

Check the email header information for proper authentication results. Every test email should show SPF: pass, DKIM: pass, and DMARC: pass in the headers. If any authentication check fails, the most likely cause is an incorrect or missing DNS record — go back and verify each record is entered exactly as specified by your provider.

For WordPress sites, test the specific email types your site sends: contact form submissions, WooCommerce order confirmations, password reset emails, and new user registration emails. Some plugins override WordPress email formatting, so verify that each email type looks correct and contains the expected content.

Administration Best Practices

For ongoing maintenance, review Google Workspace security alerts and recommendations in the Admin Console. Google provides proactive alerts about DNS configuration issues, authentication failures, and potential account compromises. Acting on these alerts promptly prevents email delivery disruptions.

Monitor your domain's sender reputation using Google Postmaster Tools (postmaster.google.com). This free dashboard shows your domain's spam rate, IP reputation, authentication success rates, and encryption usage. Keep your spam rate below 0.1% — anything above 0.3% significantly impacts inbox placement across all Gmail recipients.

When troubleshooting SMTP relay issues, verify the sending IP address is included in the allowed senders list in the Admin Console. Google Workspace SMTP relay restricts access by IP address or authenticated user — if your server's IP changes (common with cloud hosting), update the relay configuration immediately to prevent sending failures.

Frequently Asked Questions

Why is my WordPress site not sending emails?

The most common cause is that your site uses PHP mail() instead of authenticated SMTP. Most hosting servers have poor email configuration, causing messages to fail silently or land in spam. Installing an SMTP plugin like WP Mail SMTP or FluentSMTP and configuring it with a proper email service resolves this issue for the vast majority of WordPress sites.

Which SMTP plugin is best for WordPress?

WP Mail SMTP (by WPForms) and FluentSMTP are the two most reliable options. WP Mail SMTP has the largest user base and supports all major providers. FluentSMTP is free with no premium upsells and supports multiple SMTP connections. Both handle the core function — routing WordPress email through authenticated SMTP — equally well.

What SMTP port should I use for WordPress?

Port 587 with TLS encryption is the recommended standard for SMTP client submission. If your host blocks port 587, try port 465 with SSL encryption as an alternative. Port 25 is typically blocked on shared hosting and should be avoided. Your SMTP provider's documentation will confirm the correct port for their service.

Do I need a paid SMTP service for WordPress?

For sites sending fewer than 100-300 emails per day, free tiers from services like SendGrid (100/day), Brevo (300/day), or your existing Gmail/Google Workspace account may be sufficient. For WooCommerce stores or high-traffic sites, a paid transactional email service provides better deliverability, analytics, and dedicated IP addresses.