So when I execute this without modifying the header information to send html type emails it sends however when I have it send with it being an html email it never gets sent.
here is the code:
<?php
$to = "[email protected]";
$subject = "Order Confimation - mywebsite.com";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= "From: <[email protected]>";
$message = "
<!DOCTYPE html>
<html lang='en-us'>
<head>
<meta charset='utf-8'>
<title>Order Confirmation</title>
<style type='text/css'>
//style information
</style>
</head>
<body>
<div class='box'>
<h1 class='right'>Thanks!</h1>
//Blah blah blah
</div>
</body>
</html>
";
mail($to, $subject, $message, $headers);
if (mail($to, $subject, $message, $headers)) {
echo "<p class='hide'>E-mail Sent</p>";
} else {
echo "<p class='hide'>Problem</p>";
}
?>
And it returns E-mail sent however the email never goes to the inbox
Any suggestions?
Also pear package is enabled.
if (mail())part should be fine. And just double check the email address you're sending to.