SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with sending email via PHP

    Hi,

    I have been using a php script to read the values entered into a html form and send them to the website owner via email. The script is as follows (the last 5 lines are the important ones):

    <?php

    $body = "";

    // retrieve the current date
    $current_date= date("F j, Y" );

    $body = $body . "The following message was sent on " . "$current_date\n\n";

    $body = $body . "Photograph Title : " . $HTTP_POST_VARS["title"]."\n" .
    "Email Address : " . $HTTP_POST_VARS["email"]."\n" .
    "Photograph Only : " . $HTTP_POST_VARS["PhotoOnly"]."\n".
    "Matt Colour : " . $HTTP_POST_VARS["border"]."\n".
    "Framing Choices : " . $HTTP_POST_VARS["frame"]."\n".
    "Comments : \n".
    "--------\n".
    $HTTP_POST_VARS["comments"];




    // Email the form details

    mail("gallery@nalderphotographics.com",
    "Website feedback",
    $body,
    "From: purchase@nalderphotographics.com" );
    header("Location: thanks.htm" );
    ?>

    --------------
    You will notice that the last line sends the user to a thankyou page.

    This method has been working fine for at least a year. However, I have noticed that the latest Internet explorer browsers give the following error messages and do not send the user to the thankyou page:

    Warning: Failed to Connect in d:\webspace\nalderph\purchase\mailform.php on
    line 31

    Warning: Cannot add header information - headers already sent by (output
    started at d:\webspace\nalderph\purchase\mailform.php:31) in
    d:\webspace\nalderph\purchase\mailform.php on line 32

    I would appreciate it if someone could tell me what the problem is or suggest some alternative code.

    thankyou,
    Darren.

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Apologies, for accidentally posting this message twice.


Bookmarks

Posting Permissions

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