Location: PHPKode > scripts > O-Module Easy Order Form > o-module-easy-order-form/sendmail.php
<?php
####################################
#                       Powered by LoginetSolutions                              #
#                         www.loginetsolutions.com                                  #
####################################
include_once 'config.php';

// Receiving form variables
//personal info
$clientname = addslashes($_POST['clientname']); 
$company = addslashes($_POST['company']);
$website = addslashes($_POST['website']);
$phone = addslashes($_POST['phone']);
$email = $_POST['email'];
$howcontact = addslashes($_POST['howcontact']);
//shipping address
$address = addslashes($_POST['address']);
$city = addslashes($_POST['city']);
$zip = addslashes($_POST['zip']);
$state = addslashes($_POST['state']);
$country = addslashes($_POST['country']);
//misc info
$interest = addslashes($_POST['interest']);
$comments = addslashes($_POST['comments']);




$todayis = date("l, F j, Y, g:i a") ;
?>
<html>
<head>
<title><?=$myCompanyName?> - O-Module Order Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php
include_once 'default.css';
?>
</head>

<body>

<table border="0" cellspacing="0" cellpadding="0" width="600" height="26" align="center">
	<tr bgcolor="#CCCCCC" valign="middle">
		<td valign="middle" width="520" bgcolor="#F6F6F6">
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td nowrap><font color="#000000"><b>&nbsp;<?=$myCompanyName?></b></font></td>
				</tr>
			</table>
		</td>
		<td valign="middle" width="80" bgcolor="#F6F6F6">
			<table width="100%" border="0" cellspacing="0" cellpadding="0" height="20">
				<tr>
					<td bgcolor="#d3d3d3" nowrap align="center"><font color="#ffffff"><b>Order Form</b></font></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<table border="0" cellspacing="1" cellpadding="5" bgcolor="#CCCCCC" bordercolor="#F6F6F6" width="600" align="center">
        
<tr bgcolor="#FFFFFF" valign="middle"> 
          
<td valign="middle">

				<?

$to = $from_email;
$from = $from_email;;
$subject = "Website Order";


$message  = "<html><body><table width='600'><tr><td><br>You received today ".$todayis." this order from <a href='mailto:" .$email."'>".$clientname."</a> <br><br>";
$message .= "Company: ". $company . " <br><br>";
$message .= "Website: ". $website . " <br><br>";
$message .= "Phone number: ". $phone . " <br><br>";
$message .= "He's interested in: ". $interest . " <br><br>";
$message .= "He wants to be contacted by: ". $howcontact . " <br><br>";
$message .= "Comments: ". $comments . " <br><br>";
$message .= "Shipping must be done to: <br>". $address . " <br>";
$message .= $city." ".$zip." ".$state." ".$country." <br><br>";

if(is_array($_POST['cat1'])){ 
   	foreach($_POST['cat1'] as $key => $val){  
   		$message.="$cat1Name: $val<br>";
   	} 
}
if(is_array($_POST['cat2'])){ 
   	foreach($_POST['cat2'] as $key => $val){  
   		$message.="$cat2Name: $val<br>";
   	} 
}
if(is_array($_POST['cat3'])){ 
   	foreach($_POST['cat3'] as $key => $val){  
   		$message.="$cat3Name: $val<br>";
   	} 
}
$message .= " <br><br> </td></tr></table></body></html>";

 

$thmess  = "<html><body><font face='verdana' size='2'><br><b>Hello ".$clientname.",</b><br>Thank you for your order. <br>";
$thmess .= "We will contact you within 24 hours for details about your order. <br><br>Greetings, <br>$myCompanyName   </center> <br><br><br><font size='-2'>This message was sent by $myCompanyName and isn't a spam.<br>Please report if you receive this message as spam at <a href='mailto:$from_email'>$myCompanyName</a></font></body></html>";


    $headers  = "From: $from\r\n";
    $headers .= "Content-type: text/html\r\n";
    //$to = "$to, $from"; // this will send to both emails at the same time.

    // now lets send the email to the form owner
    mail($to, $subject, $message, $headers);
    // and the thank you message to the client
    mail($email, "Confirmation - Auto Response", $thmess, $headers);
	//echo "<br>Example of emails sent:<br>".$message."<br><hr>";
	//echo $thmess;

?>              	
              <p align="center"><font color="#990000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong><font color="#993300">
              Your message has been sent. We will contact you <br>
              within 24 hours for details about your Order.</font></strong></font> </p>
              </td>
</tr>
</table>
<br>
</body>
</html>
Return current item: O-Module Easy Order Form