Hi there,

I have a sendmail script that worked perfectly in php4... but my hosting company decoded to upgrade to php5 without telling me and now my script doesnt work.

It is a simple order form for a catering company, with lots of text fields and check buttons, then i use the following php sendmail script:

<?php
$name = $POST['name'];
$email = $
POST['email'];
$delivery = $POST['delivery'];
$invoice = $
POST['invoice'];
$contact = $POST['contact'];
$phone = $
POST['phone'];
$fax = $POST['fax'];
$date = $
POST['date'];
$day = $POST['day'];
$time = $
POST['time'];
$mdmenua = $POST['mdmenua'];
$buffetmenua = $
POST['buffetmenua'];
$quickmenua = $POST['quickmenua'];
$sandwicha = $
POST['sandwicha'];
$sandwichnumber = $POST['sandwichnumber'];
$mdmenub = $
POST['mdmenub'];
$buffetmenub = $POST['buffetmenub'];
$quickmenub = $
POST['quickmenub'];
$people = $POST['people'];
$invoice = $
POST['invoice'];
$creditcard = $POST['creditcard'];
$cash = $
POST['cash'];
$comments = $POST['comments'];
$agree = $
POST['agree'];
//Save visitor name and entered message into one variable:
$formcontent="BUSINESS NAME: $name\n\nDELIVERY ADDRESS: $delivery\n\nINVOICE ADDRESS: $invoice\n\nCONTACT NAME: $contact\n\nEMAIL ADDRESS: $email\n\nPHONE MUMBER: $phone\n\nFAX NUMBER: $fax\n\nDATE REQUIRED: $date\n\nDAY: $day\n\nDELIVERY TIME: $time\n\nMDS SPECIAL MENU A: $mdmenua\n\nBUFFET LUNCH MENU A: $buffetmenua\n\nQUICK LUNCH MENU A: $quickmenua\n\nMDS SPECIAL MENU B: $mdmenub\n\nBUFFET LUNCH MENU B: $buffetmenub\n\nQUICK LUNCH MENU B: $quickmenub\n\nSANDWICH PLATTER: $sandwicha\n\nNUMBER OF SANDWICH PLATTERS: $sandwichnumber\n\nNUMBER OF PEOPLE: $people\n\nINVOICE: $invoice\n\nCREDIT CARD: $creditcard\n\nCASH CHEQUE ON DELIVERY: $cash\n\nSPECIAL REQUIREMENTS: $comments\n\nTERMS & CONDITIONS: $agree";
$res = "tom@MYEMAIL.co.uk";
$subject = "Order Form";
$mailheader = "From: $email\r\n";
$mailheader .= "Reply-To: $email\r\n";
$mailheader .= "MIME-Version: 1.0\r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Failure!");
echo( 'Thank you for your order you will recieve confirmation of your order once it has been processed. Please <a href="http://www.workinglunchonline.co.uk/">click here</a> to return to the site' );
exit;

?>

my hosting company keeps telling me that i need to add a fifth parameter to this script ... what does this mean? should the script above work in php5?

Thanks for all your help... i am a bit out of my depth with all of this,

Tom

    http://php.net/manual/en/function.mail.php

    bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )

    The additional_parameters parameter can be used to pass an additional parameter to the program configured to use when sending mail using the sendmail_path configuration setting. For example, this can be used to set the envelope sender address when using sendmail with the -f sendmail option.

      My hosting company advised me to change the following line:

      mail($recipient, $subject, $formcontent, $mailheader) or die("Failure!");

      to:

      mail($recipient, $subject, $formcontent, $mailheader,"-froot@MYDOMAIN.co.uk");

      but it still does not work... any ideas?

        difference in $res and $recipient perhaps?

          You need to add the required content-type header ... you shouldn't need the -f flag

            Write a Reply...