SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Mail problem

  1. #1
    SitePoint Evangelist ColinHughes's Avatar
    Join Date
    Sep 2004
    Location
    Spain
    Posts
    468
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mail problem

    Hi

    I have a sendmail page thus:

    Code:
    <?php
    $name = $_POST['name'];
    $company_name = $_POST['company_name'];
    $address = $_POST['address'];
    $city = $_POST['city'];
    $county = $_POST['county'];
    $postcode = $_POST['postcode'];
    $country = $_POST['country'];
    $telephone = $_POST['telephone'];
    $fax = $_POST['fax'];
    $email = $_POST['email'];
    $tour_ref = $_POST['tour_ref'];
    $numberpass = $_POST['numberpass'];
    $hearabout = $_POST['hearabout'];
    $maillist = $_POST['maillist'];
    $additional = $_POST['additional'];
    
    
    $toaddress = "website@mywebsite.com";
    $subject = "A Website Enquiry Has Arrived";
    $msg = "Name: $name\n";
    $msg = "Company Name: $company_name\n";
    $msg = "Address: $address\n";
    $msg = "Town/City: $city\n";
    $msg = "County: $county\n";
    $msg = "Postcode: $postcode\n";
    $msg = "Country: $country\n";
    $msg.= "Telephone: $telephone\n";
    $msg.= "Fax: $fax\n";
    $msg.= "E-Mail: $email\n";
    $msg.= "Tour Ref: $tour_ref\n";
    $msg.= "Number of Passengers: $numberpass\n";
    $msg.= "Hear About Us: $hearabout\n";
    $msg.= "Add to Mailing List: $maillist\n";
    $msg.= "Additional Comments: $additional\n";
    
    
    
    
    $mailheaders = "From: $email\n";
    $mailheaders .= "To: website@mywebsite.com\n";
    $mailheaders .= "Content-Type: multipart/mixed; \n";
    
    mail($toaddress, $subject, $msg, $mailheaders);
    
    ?>
    My problem is that mail is only sent containing items including and after "Country", the fields and their labels before this do not output in the message.

    eg.

    Country:
    Telephone:
    Fax:
    E-Mail:
    Tour Ref:
    Number of Passengers:
    Hear About Us:
    Add to Mailing List:
    Additional Comments:

    I feel this may be one of those obvious things that one cannot see for looking but help will sure be appreciated.

    Regards

    Colin

  2. #2
    Umm. PHP Guru....Naaaah jaswinder_rana's Avatar
    Join Date
    Jul 2004
    Location
    canada
    Posts
    3,193
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    BECAUSE you have

    $msg = '';

    CHANGE IT TO $msg .='';

    NOTE .=(dot equal)
    ---------------------------
    Errors = Improved Programming.
    My Site

  3. #3
    SitePoint Evangelist ColinHughes's Avatar
    Join Date
    Sep 2004
    Location
    Spain
    Posts
    468
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Jaswinder

    THANKS

    I knew I was looking too hard for something obvious.


    Regards

    Colin


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
  •