Jump to content

Trouble with mail() function...


mem0ri

Recommended Posts

I've got a website running off a Win. 2003 Server with PHP 4.4.3 and MySQL 5 (though MySQL is unimportant to this problem).  Everything SEEMS to be working just fine...and in fact, when I send an e-mail through the contact form, I even get a report back that mail has been sent correctly...

...unfortunately...neither I, nor anyone else who tests the functionality, receives an e-mail from the contact form.  I can't find anything wrong with the code...maybe some help?  (code pasted below)

[code=php:0]
if(isset($subject) && isset($body) && $subject != "" && $body != "")
{
            for($x = 0; $x < count($email_list); $x++)
{
mail($email_list[$x], $subject, $body, $headers);

if($x == 0 && count($email_list) > 1) echo("<span class=\"notification\">E-Mail sent to: ".$email_list[$x].", ");
else if($x == 0 && count($email_list) == 1) echo("<span class=\"notification\">E-Mail sent to: ".$email_list[$x]."</span>");
else if($x == (count($email_list) - 1) && $x != 0) echo($email_list[$x]."</span>");
else echo($email_list[$x].", ");
}
}
[/code]

Umm...I guess the other relevant part may be the $headers variable...which is:

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From:'.$from."\r\n".'Reply-To:'.$from;
Link to comment
https://forums.phpfreaks.com/topic/25763-trouble-with-mail-function/
Share on other sites

The server uses POP3/SMTP.  The SMTP Service is running with MailEnable.  Also...checking the logs...I'm finding:

11/01/06 11:34:28 SMTP-OU B2C0A0D352E04445A17E73E458DD3293.MAI 364 xx.xxx.xxx.xx RCPT RCPT TO:<[email protected]> 250 Accepted 34 14


UPDATE:  It looks like the mail is sending correctly, but is being blocked by the great majority of mailbox providers.  Obviously, that's not a good thing (especially since the emailer is primarily for allowing members to reset their password).

...so...maybe some ideas on how to get these e-mails unblocked?  Maybe something in the headers? 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.