Forum Moderators: coopster
The page creates an index of employee contacts from a data base, and when you click on the name it looks up the email address and puts it in the hidden recipient form filed ( which is currently sent to text for debugging). The issue is that none of the employees are getting email, even though It generates no errors. However if I put myself in ( at a non g-g-d email address Im getting mail from the form fine). All this leads me to beleive that somehow isp or mail server may be blocking the forms email as spam.
And thinking that through I notice that in the emais that come to me the to field seems malformed I get steve@example.com; steve@example.com ( my email twice seperated by a ;) Any one have an idea as how that happens or if that could perhaps cause email not to be delivered properly
Thanks
Steve
[edited by: jatar_k at 2:15 pm (utc) on Nov. 4, 2008]
[edit reason] no urls thanks [/edit]
see if the message is ending up in a spam/junk folder or what the rules are with the mail server receiving these messages.
In the script take a look for 'To:' in the script, that might get you to the right spot and see what it's doing with the creation of the To field. You could also look at the Mail() function call itself and see if it is creating extra headers. Then look at these headers and see what's going on there.
you probably need to start dumping variable so you can see what is actually in there.
you can use this at the top to see what is being posted to the script
echo '<pre>';
print_r($_POST);
echo '<pre>';
then you could also echo the variables used in the mail call to see what's going in there
then look at the message source of the email to see what arrived
and then compare
recipient] => steve@example.com
[subject] =>
[require] => email,name,message
[name] => sd
[company] => sd
[email] => steve@example2.com
[phone] =>
[message] => asdasd
The mail function looks this
mail($recipient, $subject, $message, $headers);
and if i echo $ recipient at that point. I get a single address
like this as expected
its thesteve@example.com
[edited by: jatar_k at 8:06 pm (utc) on Nov. 4, 2008]
[edit reason] removed specifics [/edit]
// mail the content we figure out in the following steps
function mail_it($content, $subject, $email, $recipient) {
global $attachment_chunk, $attachment_name, $attachment_type, $attachment_sent, $bcc;
echo $recipient; //sb
$ob = "----=_OuterBoundary_000";
$ib = "----=_InnerBoundery_001";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "From: ".$email."\n";
$headers .= "To: ".$recipient."\n";
$headers .= "Reply-To: ".$email."\n";
if ($bcc) $headers .= "Bcc: ".$bcc."\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-Mailer: DT Formmail".VERSION."\n";
$headers .= "Content-Type: multipart/mixed;\n\tboundary=\"".$ob."\"\n";
echo $headers;
$message = "This is a multi-part message in MIME format.\n";
$message .= "\n--".$ob."\n";
$message .= "Content-Type: multipart/alternative;\n\tboundary=\"".$ib."\"\n\n";
$message .= "\n--".$ib."\n";
$message .= "Content-Type: text/plain;\n\tcharset=\"iso-8859-1\"\n";
$message .= "Content-Transfer-Encoding: quoted-printable\n\n";
$message .= $content."\n\n";
$message .= "\n--".$ib."--\n";
if ($attachment_name && !$attachment_sent) {
$message .= "\n--".$ob."\n";
$message .= "Content-Type: $attachment_type;\n\tname=\"".$attachment_name."\"\n";
$message .= "Content-Transfer-Encoding: base64\n";
$message .= "Content-Disposition: attachment;\n\tfilename=\"".$attachment_name."\"\n\n";
$message .= $attachment_chunk;
$message .= "\n\n";
$attachment_sent = 1;
}
$message .= "\n--".$ob."--\n";
mail($recipient, $subject, $message, $headers);
}