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 no-reply@domain.com 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("ADMIN_EMAIL@gmail.com", $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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.