I’m building out an email receipt that goes back to a user after they register for an upcoming event on one of our sites, but gmail is consistently sending it to the spam folder. I’ve isolated the issue to the body content of this html email:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Zzzzzzz Online PATHe Registration</title>
</head>
<body>
<p>Dear <?php echo $data['f_name']; ?>,</p>
<p>
Thank you for registering for our upcoming open house. We will be in
touch shortly to arrange a meeting time on <?php echo $data['date'];?>.
</p>
<p>
The open house will be given at our Zzzzzzz Avenue Campus located at
175 Zzzzzzz Ave, Zzzzzzz AL.
Look up directions on <a href="<?php echo $gmaps;?>" target="_blank">
Google Maps</a> or <a href="<?php echo $mapq;?>" target="_blank">Mapquest</a>.
</p>
<p>We look forward to meeting you,</p>
<p>
<a href="http://online.zzzzzzz.edu">Zzzzzzz College Online</a><br/>
<a href="mailto:info@zzzzzzz.edu">info@zzzzzzz.edu</a><br/>
(877)772-2265
</p>
</body>
</html>
I’ve tried these things:
- Html with doctype that fully validates
- Replaced shortened urls for map sites with full length urls
- Tried email without any urls at all
So all I can think of is the language being used, but this is a perfectly valid response. A user who fills out this form is asking the college to contact them to set up a meeting for dates that they select. What am I missing here??
EDIT: the following content passes the spam test just fine. Ironically we started with this but rewrote it because it’s too generic and does not give the user actionable information about the location of the open house:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Zzzzzz Online Open House Registration</title>
</head>
<body>
<p>Dear Micah,</p>
<p>Thank you for registering for our upcoming open house. We will be in touch
shortly to arrange a time and to answer any questions you may have.</p>
<p>For directions and more information, please visit out open house page at
http://online.zzzzzzz.edu/open-house. In the meantime, if you have any
questions or concerns that come up between now and the open house please feel
free to contact us.</p>
<p>We look forward to meeting you,</p>
<p>Zzzzzz College Online</p>
</body>
</html>
I am not an expert in this field, but a quick Google search of the error you are receiving says that you should include both a text/html MIME type and a text/plain MIME type, as normal e-mails will contain both, while SPAM usually only contains the text/html version.