Jump to content

[SOLVED] Confirmation Email


mraza

Recommended Posts

hi all ! i wants to send a confirmation e-mail to a visitor upon completing the form and one e-mail to myself can somebody help me to give a coding base. Thanks you very much: i am using this code to show a confirmation page. This is the form page for user:

 

form.php

------------------

<form method="post" action="sendmail.php">
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>
<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />
<table width="385"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="171">
<strong>Subject</strong><br />
	 <select name="attn" style="width:171px; height:20px; font-family:Tahoma, Arial, Helvetica, sans-serif; font-size:11px; ">
	 <option value="Booking Inquiry (foo.com)">Booking Concern</option>
	 <option value="Support Request (foo.com)">Support Request</option>
	 <option value="Billing Issue (foo.com)">Billing Issue</option>
	 <option value="Other Inquiry (foo.com)">Other Issue</option>		 
	 </select>
<strong>Full Name</strong><br />
<input type="text" name="visitor" style="width:171px; height:20px; font-family:Tahoma, Arial, Helvetica, sans-serif; font-size:11px; ">
<img src="images/spacer.gif" height="4" style="display:block ">	
<strong>E-mail</strong><br />
<input type="text" name="visitormail" style="width:171px; height:20px; font-family:Tahoma, Arial, Helvetica, sans-serif; font-size:11px; ">
<img src="images/spacer.gif" height="4" style="display:block ">	
<strong>Phone/Fax</strong><br />
<input type="text" name="phone" style="width:171px; height:20px; font-family:Tahoma, Arial, Helvetica, sans-serif; font-size:11px; ">

</td>
    <td width="24"><img src="images/spacer.gif" width="100" height="1"></td>
    <td width="120">
<strong>Message</strong><br />
<textarea name="notes" style="margin-left: 20px; width:270px; height:130px; overflow:auto; font-family:Tahoma, Arial, Helvetica, sans-serif; font-size:11px; "></textarea>	
<div style="padding-top:9px; " align="right">
<input type="reset" style="width:56px; height:19px; background-image:url(images/clear.jpg); border:0px none; cursor:hand; cursor:pointer " value=""><input type="submit" style="width:56px; height:19px; background-image:url(images/send.jpg); border:0px none; cursor:hand; cursor:pointer; margin-left:10px " value="">
</div>
</td>
  </tr>
</table>

</form>

 

 

====================================

and this is sendmail.php

 

 

sendmail.php

<?php

$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$visitor = $_POST['visitor'];
$visitormail = $_POST['visitormail'];
$notes = $_POST['notes'];
$budget = $_POST['budget'];
$phone = $_POST['phone'];
$attn = $_POST['attn'];


if (eregi('http:', $notes)) {
die ("Do NOT try that! ! ");
}
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h3>Use Back - Enter valid e-mail</h3>\n";
$badinput = "<h3>Feedback was NOT submitted</h3>\n";
echo $badinput;
die ("Go back! ! ");
}

if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<h3>Use Back - fill in all fields</h3>\n";
die ("Use back! ! ");
}

$todayis = date("l, F j, Y, g:i a") ;

$attn = $attn ;
$subject = $attn;

$notes = stripcslashes($notes);

$message = " $todayis [EST] \n
Attention: $attn \n
Message: $notes \n
From: $visitor ($visitormail)\n
Budget: $budget \n
Phone: $phone \n
Additional Info : IP = $ip \n
Browser Info: $httpagent \n
Referral : $httpref \n
";

$from = "From: $visitormail\r\n";


mail("[email protected]", $subject, $message, $from);

?>
<h3>Message Confirmation</h3>
<br /><br />
Date: <?php echo $todayis ?>
<br />
Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> )
<br />
Subject: <?php echo $attn ?>
<br />
Phone: <?php echo $phone ?> 
<br />
Message:<br />
<?php $notesout = str_replace("\r", "<br/>", $notes);
echo $notesout; ?>
<br /><br />
Thanks for Contacting Us . We have recived your inquery message and Our Support team will be in touch with you soon !!!<br /><br />
<a href="index.html"> Back To Home </a>

==================

 

with those files i can show the users one page showing there data what they submitted and i get one email...how can i send also one email to sender. Thanks

 

 

Link to comment
https://forums.phpfreaks.com/topic/171767-solved-confirmation-email/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.