Jump to content

Mail Reciept help


seriosbrad

Recommended Posts

I have this script setup to send a mail to myself when someone fills out a form.  What I want is the same thing mailed as a reciept to the person that filled out a form but only with a change of it's content.  It should come from [email protected] so they can't reply to the reciept and the only change in the content that is mailed should be a line of added text like "This is a reciept of your inquiry - you can not reply to this"

 

<?
$subject="Domain.com Inquiry: ".$_GET['subject'];
$headers= "From: ".$_GET['email']."\n";
$headers.='Content-type: text/html; charset=iso-8859-1';
mail("[email protected]", $subject,  "
<html>
<head>
<title>Contact letter</title>
</head>
<body>
<table class='readonly' cellspacing='0' style='width:100%;border-bottom:1px solid #eee;font-size:12px;line-height:135%;font-family:Lucida Grande, Tahoma, Arial, sans-serif;'>
		<tr style='background-color:#F5F5F5'>
	<th style='vertical-align:top;color:#222;text-align:left;padding:7px 9px 7px 9px;border-top:1px solid #eee;'>
		Name: 
		<span class='req' style='color:red'>*</span>		</th>
	<td style='vertical-align:top;color:#333;width:60%;padding:7px 9px 7px 0;border-top:1px solid #eee;'>
	<span class='fn n'>
		<span class='given-name'>".$_GET['firstname']."</span>
		<span class='family-name'>".$_GET['lastname']."</span>
	</span>
	</td>
</tr>
<tr style='background-color:#FFFFFF'>
	<th style='vertical-align:top;color:#222;text-align:left;padding:7px 9px 7px 9px;border-top:1px solid #eee;'>
		E-Mail: 
		<span class='req' style='color:red;'>*</span>		</th>
	<td style='vertical-align:top;color:#333;width:60%;padding:7px 9px 7px 0;border-top:1px solid #eee;'>
	<a class='email' href='mailto:".$_GET['email']."'>".$_GET['email']."</a>
	</td>
</tr>
<tr style='background-color:#F5F5F5'>
	<th style='vertical-align:top;color:#222;text-align:left;padding:7px 9px 7px 9px;border-top:1px solid #eee;'>
		What would you like help with? 
			</th>
	<td style='vertical-align:top;color:#333;width:60%;padding:7px 9px 7px 0;border-top:1px solid #eee;'>
		<div>".$_GET['subject']."</div>
	</td>
</tr>

		<tr style='background-color:#FFFFFF'>
		<th style='vertical-align:top;color:#222;text-align:left;padding:7px 9px 7px 9px;border-top:1px solid #eee;'>
			Please provide us with more details. 
			<span class='req' style='color:red'>*</span>			</th>
		<td style='vertical-align:top;color:#333;width:60%;padding:7px 9px 7px 0;border-top:1px solid #eee;'>
			<div>".$_GET['message']."</div>
		</td>
	</tr>
	</table>
</body>
</html>" , $headers);
echo ("
<html xmlns='http://www.w3.org/1999/xhtml' class=' firefox'>
<head>

<title>
AYS Contact
</title>

<!-- Meta Tags -->
<meta http-equiv='REFRESH' content='5;url=http://www.domain.com'>
<meta name='robots' content='index, nofollow, noarchive' />
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<meta name='description' content='Contact form for Domain.com' />

<!-- CSS -->
<link rel='stylesheet' href='http://www.domain.com/contact/css/forms/dynamic.css' type='text/css' />

</head>

<body id='public'  >

<div id='container'>

<h1 id='logo'>
<a href='http://www.domain.com' title='domain name'>domain name</a>
</h1>

<form id='contact_form' name='contact_form' class='wufoo topLabel page1' autocomplete='off' name='contact_form' action='contact.php' method='get' onsubmit='return formCheck(this);'>   

<div class='info'>
<h2>domain - Confirmation</h2>
<div>Thank you for contacting me - Please wait 5 seconds to be redirected or click <a href='http://www.domain.com'>here</a></div>
</div>


</form>

</div>
</body>
</html>
");
?>

 

$_GET['email'] gets their email from the form

 

Link to comment
https://forums.phpfreaks.com/topic/192078-mail-reciept-help/
Share on other sites

Take the html content and use two heredocs, split it where you want your change to go($heredoc1.=$heredoc2). Send to yourself. Then change what you need with the heredoc($heredoc1.=$addition)($heredoc1.=$heredoc2) send it to the form email. Maybe add some error checking and form data cleaning.

 

 

HTH

Teamatomic

Link to comment
https://forums.phpfreaks.com/topic/192078-mail-reciept-help/#findComment-1012353
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.