Sending auto reply using PHP form

  lonemascot 09:25 08 Dec 2010

I have a form and its working ok apart from the fact my autoreply doesn't.

I can send the form results to my email fine but i also want to send an email to the customer stating that i have recieved their information etc.

here is my releveant code


$to = "[email protected]" ;

$title = $_REQUEST ["title"] ;
$other = $_REQUEST ["other"] ;
$forename = $_REQUEST ["forename"] ;
$surname = $_REQUEST ["surname"] ;

$autoreply = "[email protected]";
$autoreplymsg = "Thank you $title $other $surname\n
We have received your quotation request and shall be dealing with it shortly.\n
Thank you\n
The sales team\n
This email was sent from an un-monitored address please do not reply to this message.\n
All of our contact details can be found at click here";

$body = "Customer name: ".$title. $other. $forename. $surname."\n
\n ".$address1." \n
".$address2." \n
".$town." \n
".$county." \n
".$postcode." \n
Email: ".$from." \n
Telephone: ".$contact."\n
Email: ".$email."\n
A: ".$a." m ".$edgea."\n
B: ".$b." m ".$edgeb."\n
C: ".$c." m ".$edgec."\n
D: ".$d." m ".$edged."\n
E: ".$e." m ".$edgee."\n
F: ".$f." m ".$edgef."\n\n

Additional comments: ".$comment." \n\n

Respond via: ".$response."\n ";

mail( $to, "Flat roof quote", $body, "From: ".$email."");

mail( $email, "Thank you for your quotation request", $autoreplymsg, "From: ".$autoreply."");

header( "Location: $thankyou" );



I have removed most of the irrelevant code and changed the emails for security reasons.

Please forgive my lack of knowledge as its my script and I'm learning as i go.

how do i send to both of the mail = ()?

  Ansolan 02:22 10 Dec 2010

Might be easier to use a specific email address for the form and set up an Auto-Responder at your domain. You should find this available in Cpanel, or similar systems.

  lonemascot 01:15 12 Dec 2010

Thanks for your help. I managed to work out what I needed to do in the end. I wanted to use fields from the form such as customer name and what they had input in my autoreply so couldn't do that via c panel.

PHP is a lot less complicated than i had previously thought and i love all the cool things you can do with it.

thanks again

  wholesale handbags 11:06 16 May 2011

This beautifully designed white designer handbags was conceived and crafted in Italy. Very charming and stylish for any occasion. There are a limited number of pieces available for this wholesale handbags, so don't lose your chance to own one of the most sought-after cheap designer handbags to your personal collection. wholesale designer handbags new with tags, 93%-cotton, 7%-elastane?Welcome to our discount designer handbags store. Have a good handbags for you !ZXZxXZX

  lotvic 11:57 16 May 2011

wholesale handbags is SPAMMER, hopefully FE will look at his Profile and delete all of his posts

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Samsung Galaxy A8 review: Hands-on

Illustrator Juan Esteban Rodriguez on creating highly detailed official film posters for Star Wars…

iMac Pro review

Meilleurs drones (2018)