I'm working on a reset password script for my CMS, that will generate
a random password and email it to a user when they request one. The
problem I am having is that the mails being sent out are beign marked
as spam by our internal mail system and never reaching users'
inboxes. I've also discovered that Yahoo Mail considers these mails
to be spam, but it moves them to the spam folder instead of just
dropping them.
I wrote a simple mail script for testing purposes at http :// cms .
merus . co . uk / mailtest . php (remove whitespace for correct URL)
in an attempt to figure it out and have been using it to send myself
messages to my yahoo inbox in an attempt to figure out why they are
being marked as spam. The script source code is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/
TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form id="form1" method="post" action="">
<p>
<label for="to">To</label>
<input type="text" name="to" id="to" />
</p>
<p>
<label for="subj">Subject</label>
<input type="text" name="subj" id="subj" />
</p>
<p>
<label for="msg">Message</label>
<textarea name="msg" cols="60" rows="8" id="msg"></textarea>
</p>
<p>
<label for="Submit">Submit</label>
<input type="submit" name="Submit" value="Submit" id="Submit" />
</p>
</form>
</body>
</html>
<?php
$headers = 'From: cm*@cms.merus.co.uk
Return-Path: cm*@cms.merus.co.uk
Reply-To: cm*@cms.merus.co.uk
X-Mailer: PHP '.phpversion ().'
';
if ($_POST)
{
var_dump (mail ($_POST ['to'], $_POST ['subj'], $_POST ['msg'],
$headers));
}
?>
I've examined the headers that Yahoo sees with the view full headers
feature, but nothing that would obviously get the message flagged as
spam came up, though the X-Mailer header seems to be missing. If
anyone else can take a look at this and provide some helpful insight
I'd appreciate it.