Jump to content

Archived

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

tleisher

mail() acting up

Recommended Posts

Why would this code print the message twice in the mail:

[code=php:0]$from = "forgotten@".$hostname;
            $to = $lost_email;
            $subject = "Password Reminder From ".$hostname;
           
            $headers = "MIME-Version: 1.0\r\n".
          "Content-type: text/html; charset=iso-8859-1\r\n".
          "From: \"Password Reminder\" <".$from.">\r\n".
          "To: \"User\" <".$to.">\r\n".
         
          # Mail message
         
          $message = "
            Someone (hopefully you) requested that your password be reset, if you received this in error please e-mail your
            admin at " . $author_email . "<br /><br />You're new password is: " . $n_pass;
           
            $response = mail($to, $subject, $message, $headers); 
[/code]

Returns this in the email:

[quote] Someone (hopefully you) requested that your password be reset, if you received this in error please e-mail your admin at *******

You're new password is: ******* Someone (hopefully you) requested that your password be reset, if you received this in error please e-mail your admin at *******

You're new password is: *******[/quote]

Share this post


Link to post
Share on other sites
?? That is wierd. I have never had that happen before. I doubt this will fix it but try placeing the $message before the headers.

Good Luck,
Tom

Share this post


Link to post
Share on other sites
i think that not all the code as i suspect you got the message around a for loop i guess?

Share this post


Link to post
Share on other sites
yup it must be sumething else, just adapted your code to test, and couldn't reproduce the error..

Maybe showing the complete script would help.

Share this post


Link to post
Share on other sites
That was the whole mail() part of it, anything involving it anyway.

The problem was that I had $to, and a To: variable in my header, so it had it twice.. for some reason that made it angry and when I removed the To: in $headers, it works.

Share this post


Link to post
Share on other sites

×

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.