Background
After setting up my custom domain email address (a process I wrote about in my post Setting Up Google Workspace for ParaRift: What I Learned the Hard Way), my next priority was giving site visitors a way to contact me.
However, one of the main things I wanted to avoid was publishing my email address in plain text for every automated scraper on the web. My email is tied directly to my Google Workspace account, and leaving it out in the open makes it vulnerable to spam networks and marketing lists.
I needed a way to make contacting me convenient for humans without handing my address to bots.
The Core Dilemma: Exposed Emails vs. Harvesters
Automated programs constantly scan public web pages searching for mailto links and text matching email patterns. While publishing an email address doesn’t guarantee you’ll be flooded with spam overnight, taking proactive measures to minimize exposure is a sensible defense.
Before settling on a solution, I looked at a few common ways people handle this problem.
Alternative Obfuscation Methods (And Their Drawbacks)
There are several traditional approaches to keeping an email address off plain HTML pages, but most come with trade-offs:
- Leaving the Email Off Entirely: Direct visitors to a contact form instead of displaying the email address.
- JavaScript Assembly: Building the address dynamically in the browser (e.g., combining
useranddomainvariables). While this stops simple scrapers, modern bots often execute JavaScript and can easily reconstruct the address. - HTML Character Entities: Replacing characters with entity codes (e.g., using
@for@). Most automated tools decode these instantly. - Displaying as an Image: Rendering the text inside an image file. This hurts user experience—it breaks copy-paste functionality and creates accessibility issues for screen readers.
- WordPress Plugins: Obfuscation plugins use various encoding tricks, but efficacy depends heavily on the specific technique used.
None of these methods are foolproof. Scrapers continue to evolve with optical character recognition (OCR) and full browser rendering engines.
My Solution: A WordPress Contact Form
Instead of obfuscating an email address on the page, the most reliable path was to route messages through a contact form. Visitors fill out their name, email, and message, and the site sends the delivery directly to my inbox without ever exposing my address in the source code.
To build this, I used two plugins from WPManageNinja: Fluent Forms (to create the frontend interface) and FluentSMTP (to handle deliverability).
How I Built It: Connecting FluentSMTP to Google Workspace
Setting up the form interface was quick, but routing emails securely through Google Workspace required configuring an OAuth connection in Google Cloud.
Note: I learned that with Google Workspace, a limited number of free Google Projects are available with the paid subscription I am on. Setting up the contact form takes one of these Google Projects.
[WordPress / Fluent Forms]
│
▼
[FluentSMTP]
│ (OAuth 2.0 / Gmail API)
▼
[Google Cloud Console] ──► [Google Workspace Inbox]
1. Initial Plugin Configuration
In WordPress, I navigated to Settings → FluentSMTP and selected Gmail / Google Workspace as the provider. FluentSMTP generated an Authorized Redirect URI, which I copied for the Google Cloud setup.
2. Google Cloud Project Setup
I opened the Google Cloud Console and created a new project named WordPress SMTP Connector.
Note: Because I was using a Google Workspace account, Google Cloud required selecting a parent organization during project creation rather than leaving it unattached.
3. Enabling the Gmail API
Inside the new project, I navigated to APIs & Services → Library, searched for the Gmail API, and enabled it.
4. OAuth Consent Screen
Under APIs & Services → OAuth consent screen:
- Set User Type to Internal (since the application only routes messages within my Google Workspace account).
- Provided the required app name, support email, and developer contact details.
5. Generating Credentials
Under APIs & Services → Credentials:
- Clicked Create Credentials → OAuth client ID.
- Set application type to Web application.
- Pasted the Authorized Redirect URI provided by FluentSMTP.
- Generated the Client ID and Client Secret.
6. Authenticating & Testing
I pasted the Client ID and Client Secret back into FluentSMTP, clicked Authenticate with Google, and logged into my Google Workspace account to grant access.
Once authorized, I used FluentSMTP’s Email Test tool to send a test message. It delivered successfully.
Form Setup & Final Considerations
With the SMTP pipeline operational, I finalized the form in Fluent Forms, mapped the notification routing to my inbox, and embedded it on the site.
When implementing a contact form setup, keep these factors in mind:
- Spam Protection: Forms can still be target practice for spambots. Honeypot fields or CAPTCHA tools help filter submission noise.
- Deliverability: Sending directly through Google Workspace via OAuth ensures strong deliverability compared to standard PHP
mail(). - Privacy & Accessibility: Inform visitors how their submitted details are handled, and ensure the form is fully navigable via screen readers and keyboards.
Final Thoughts
The entire configuration took about two hours, with most of the time spent working through Google Cloud Console permissions and organizational settings.
Using a contact form connected via FluentSMTP and Google Workspace gives visitors a reliable way to get in touch while keeping my email address off public pages.
Leave a Reply