Tuesday, December 31, 2013

Sending mail with PHP with High Importance in header

$to = "ryanm@calshingle.com";

// subject
$subject = 'A Customer has contacted you.';

// message
$message = '
<html>
<head>
 <title>Customer Details</title>
</head>
<body>
 <table>
<tr>
 <td><strong>Below is the Customer details-</strong></td><td></td><td></td><td></td>
</tr>
<tr>
 <td>&nbsp;</td><td></td><td></td><td></td>
</tr>
<tr>
 <td><strong>Email Address :</strong></td><td><strong>'.$email.'</strong></td>
</tr>
<tr>
 <td><strong>First Name :</strong></td><td><strong>'.$fname.'</strong></td>
</tr>
<tr>
 <td><strong>Last Name :</strong></td><td><strong>'.$lname.'</strong></td>
</tr>
<tr>
 <td><strong>Phone Number :</strong></td><td><strong>'.$phone.'</strong></td>
</tr>
<tr>
 <td><strong>What kind of Stove are you interested in :</strong></td><td><strong><strong>'.$stoves.'</strong></strong></td>
</tr>
<tr>
 <td><strong> How did you find us? :</strong></td><td><strong>'.$findus.'</strong></td>
</tr>
<tr>
 <td><strong>Requests or comments  :</strong></td><td><strong>'.$comments.'</strong></td>
</tr>
 </table>
</body>
</html>
';

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "X-Priority: 1 (Highest)\n"; 
$headers .= "X-MSMail-Priority: High\n"; 
$headers .= "Importance: High\n"; 

$headers .= 'To: Ryan <'.$to.'>' . "\r\n";
$headers .= 'From: Calstove <info@calstove.com>' . "\r\n";

No comments:

Post a Comment