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
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:<junkmail@mydomain.com> 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? 
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.