Jump to content


Photo

mail() acting up


  • Please log in to reply
5 replies to this topic

#1 tleisher

tleisher
  • Members
  • PipPipPip
  • Advanced Member
  • 88 posts

Posted 02 September 2006 - 03:10 PM

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

$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);  

Returns this in the email:

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: *******



#2 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 02 September 2006 - 03:15 PM

?? 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

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 02 September 2006 - 03:16 PM

i think that not all the code as i suspect you got the message around a for loop i guess?
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#4 w32

w32
  • Members
  • PipPip
  • Member
  • 28 posts

Posted 02 September 2006 - 03:20 PM

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.

#5 tleisher

tleisher
  • Members
  • PipPipPip
  • Advanced Member
  • 88 posts

Posted 02 September 2006 - 04:11 PM

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.

#6 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 02 September 2006 - 04:13 PM

i love the reply but well done good luck.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users