how to send email to client with php form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vinpkl
Forum Newbie
Posts: 9
Joined: Tue Aug 12, 2008 5:34 am

how to send email to client with php form

Post by vinpkl »

hi everyone

i m using the below mentioned script for enquiry form on my clients site. this script works well and my client receives the query when someone fills the form.
but my client wants that when the visitor on his site fills the equiry form, then the visitor should also receive a confirmation mail that we have received your query.

what should be added in the below script.

vineet


<?php

$Visitor_F_Name; //Name Of Visitor.
$Visitor_DOB_Day; //Day Of Visitor's DOB.
$Visitor_DOB_Month; //Month Of Visitor's DOB_Month.
$Visitor_DOB_Year; //Year Of Visitor's DOB_Year.
$Visitor_Address; //Address Of Visitor.
$Visitor_Country; //Country Of Visitor.
$Visitor_Tele_Code; //Telephone Code Of Visitor.
$Visitor_Tele_Number; //Telephone Number Of Visitor.
$Visitor_E-mail_Id; //Visitors Email address.
$Visitor_Choice_Country; //Country Choice Of Visitor.
$Visitor_Ten; //Visitor Tength Univercity.
$Visitor_T_Percentage; //Visitor 10th Percentage.
$Visitor_TenP2; //Visitor 10+2 Univercity.
$Visitor_TenP2_Percantage; //Visitor 10+2 Percentage.
$Visitor_Dig; //Visitor Degree's Univercity.
$Visitor_Dig_Percantage; //Visitor Degree's Percentage.
$Visitor_Master; //Visitor Master's Univercity.
$Visitor_Mast_Percentage; //Visitor Master's Percentage.
$Visitor_Other_Q; //Visitor's Other Qualification.
$Visitor_O_Percentage; //Visitor's Percentage.
$Visitor_O_Information;

//Assignment of form values in variables.

$Visitor_F_NAme=$textfield;
$Visitor_DOB_Day=$Day;
$Visitor_DOB_Month=$select;
$Visitor_DOB_Year=$select2;
$Visitor_Address=$text1;
$Visitor_Address.=",\n ";
$Visitor_Address.=$text2;
$Visitor_Address.=",\n ";
$Visitor_Address.=$text3;
$Visitor_Country=$textfield42;
$Visitor_Tele_Code=$textfield3;
$Visitor_Tele_Number=$textfield4;
$Visitor_Email_Id=$textfield23;
$Visitor_Choice_Country=$select3;
$Visitor_Ten=$textfield322;
$Visitor_T_Percentage=$textfield34;
$Visitor_TenP2=$textfield32;
$Visitor_TenP2_Percantage=$textfield342;
$Visitor_Dig=$textfield33;
$Visitor_Dig_Percantage=$textfield343;
$Visitor_Master=$textfield37;
$Visitor_Mast_Percentage=$textfield344;
$Visitor_Other_Q=$textfield372;
$Visitor_O_Percentage=$textfield345;
$Visitor_O_Information=$textarea2;

$message = "Full Name: $Visitor_F_NAme\n";
$message .="Date Of Birth: $Visitor_DOB_Day - $Visitor_DOB_Month - $Visitor_DOB_Year\n";
$message .= "Address: $Visitor_Address\n";
$message .= "Country: $Visitor_Country\n";
$message .= "Telephone No: $Visitor_Tele_Code - $Visitor_Tele_Number\n";
$message .= "Email ID: $Visitor_Email_Id\n";
$message .= "Choice Country: $Visitor_Choice_Country\n";
$message .= "10nth Board: $Visitor_Ten\n";
$message .= "10nth Percentage: $Visitor_T_Percentage\n";
$message .= "12th Board: $Visitor_TenP2\n";
$message .= "12th Percentage: $Visitor_TenP2_Percantage\n";
$message .= "Degree: $Visitor_Dig\n";
$message .= "Degree Percentage:$Visitor_Dig_Percantage\n";
$message .= "Master: $Visitor_Master\n";
$message .= "Master Percentage:$Visitor_Mast_Percentage\n";
$message .= "Other Qual: $Visitor_Other_Q\n";
$message .= "Other Percantage: $Visitor_O_Percentage\n";
$message.= "Other Information:$Visitor_O_Information";
$from ="info@vinpkl.com";
$to = "response@vinpkl.com";
$subject = "ASSESMENT FORM RESPONSE";
$headers = "From: $from";

mail($to,$subject,$message,$headers);
$URL="thanx.htm";
header ("Location: $URL");

?>
Geteburg
Forum Commoner
Posts: 25
Joined: Tue Aug 12, 2008 1:57 pm

Re: how to send email to client with php form

Post by Geteburg »

Easiest solution, add his email to TO field.

Code: Select all

 
$to = "response@vinpkl.com, " . $Visitor_E-mail_Id; // Emails seperated by comma
 
Post Reply