We use cookies to provide you with a better experience. If you continue to use this site, we'll assume you're happy with this. Alternatively, click here to find out how to manage these cookies

hide cookie message
 
Contact Forum Editor

Send an email to our Forum Editor:


PLEASE NOTE: Your name is used only to let the Forum Editor know who sent the message. Both your name and email address will not be used for any other purpose.

Web Design Help


It's free to register, to post a question or to start / join a discussion


 

Sending auto reply using PHP form


lonemascot

Likes # 0

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

?php

$to = "myemail@mysite.co.uk" ;

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


$autoreply = "autoreply@mysite.co.uk";
$autoreplymsg = "Thank you $title $other $surname\n
\n
We have received your quotation request and shall be dealing with it shortly.\n
\n
Thank you\n
\n
The sales team\n
\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
Address:
\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" );

exit;

?>


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 = ()?

Like this post
Ansolan

Likes # 0

Hi
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.

Like this post
lonemascot

Likes # 0

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

Like this post
wholesale handbags

Likes # 0

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 day.cheap handbags for you !ZXZxXZX

Like this post
lotvic

Likes # 0

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

Like this post

Reply to this topic

This thread has been locked.



IDG UK Sites

Samsung Galaxy Note 4 release date, price and specs 2014

IDG UK Sites

iOS 8 features wishlist: the changes iPhone and iPad users want in Apple's iOS 8

IDG UK Sites

25 Years of the World Wide Web: Happy Birthday, Intenet

IDG UK Sites

Developers get access to more Sony camera features