[RESOLVED] PLEASE HELP... sendmail script

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 = "[email protected]";
$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.phpbuilder.com/board/archive/index.php/"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,

<!-- m --><a class="postlink" href="Tomhttp://php.net/manual/en/function.mail.php">Tomhttp://php.net/manual/en/function.mail.php</a><!-- m -->

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,"[email protected]");

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
 
Back
Top