Results 1 to 4 of 4

Thread: PHP mail()

  1. #1
    Join Date
    Jan 2005

    PHP mail()

    Why does this code e-mail the message twice right after the other?

    PHP Code:
                $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); 

  2. #2
    It shouldn't could you post some more of the preceding code (any loops etc).
    Cheap web hosting
    Any CMS pre-installed
    Joomla Hosting

  3. #3
    Join Date
    Mar 2006
    This has been reported many times on the net that email repititions from the same action can be seen from email server configurations 'or' from the modulation that has been programmed from, in this case, PHP.

  4. #4
    Join Date
    Aug 2002
    PHP isn't to blame here look to two things:

    - segfaults in your apache handler
    - proper configuration of sendmail in php.ini

    Note also that some 'web managers' or cache mechanisms such as 'fasterfox' or 'maxthon' will post multiple header requests for a single page as it is requested. If this is the case the result will be duplicate fetching of the page.

    Get FireFox and the "Live HTTP Headers" extension and make sure the requests are only being sent once.
    circlical - hosting software development
    forums * blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts