Prevent Email Warning from Gmail

What to do if Gmail keeps warning you that the email from your site's contact form might not be from the email's user


If you use SPForm or another email add-on for a contact form and have been getting warnings from Gmail suggesting that the user who emailed you might not be who they claim to be, this article will explain why that happens and how to prevent it.


MODX logo

The Problem

The error usually occurs when you use Gmail and so does the user filling out the contact form. By default, SPForm uses the email address entered by the user for both the "from" and the "Reply-to" fields. The message sent from the contact form is sent to the site admin (or whoever) using your server or a server you designate. If that "from" address (entered by the user) is a gmail.com address, Gmail knows it really didn't come from Gmail and warns you that the user might be trying to mislead you.


The Solution

The trick for solving this is to tell the email extra to use the emailsender System Setting for the "from" address. For SPForm, setting the &useemailsender property to `1` in the SPForm tag will tell SPForm to use the System Setting rather than the email entered in the form.

Now, SPForm will use the emailsender System Setting for the "from" address. The email entered by the user will still go in the "reply-to" header so you'll still be able to reply to the user's email in the normal way. Because the "from" address is your address, not the user's, Gmail won't complain about any possible chicanery.

To make this work, be sure that the emailsender System Setting is an address at the domain of your site, or that it matches the server that's going to be sending the email.

For other contact form systems, you can explicitly set the "from" address (and sometimes the "sender" address) to an email address at your server and set "reply-to" to the address the user entered.


Something Else to Think About

If you've been sending other message to your users (e.g., registration messages), and your "from" address is at Gmail, Gmail users may be getting the same warning messages described above. That could definitely affect the number of users who follow through on the registration process.


Coming Up

In the next article, we'll see how to create a widget to toggle a Yes/No System Setting.



For more information on how to use MODX to create a web site, see my web site Bob's Guides, or better yet, buy my book: MODX: The Official Guide.

Looking for high-quality, MODX-friendly hosting? As of May 2016, Bob's Guides is hosted at Hosting.com (formerly A2 Hosting). (More information in the box below.)



Comments (0)


Please login to comment.

  (Login)