tleisher Posted September 2, 2006 Share Posted September 2, 2006 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] Quote Link to comment Share on other sites More sharing options...
tomfmason Posted September 2, 2006 Share Posted September 2, 2006 ?? 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 Quote Link to comment Share on other sites More sharing options...
redarrow Posted September 2, 2006 Share Posted September 2, 2006 i think that not all the code as i suspect you got the message around a for loop i guess? Quote Link to comment Share on other sites More sharing options...
w32 Posted September 2, 2006 Share Posted September 2, 2006 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. Quote Link to comment Share on other sites More sharing options...
tleisher Posted September 2, 2006 Author Share Posted September 2, 2006 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. Quote Link to comment Share on other sites More sharing options...
redarrow Posted September 2, 2006 Share Posted September 2, 2006 i love the reply but well done good luck. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.