So I’ve just started moving a large project from a testing server, to what will eventually be the live server.
Part of the application involves sending an HTML email to users who have completed certain tasks.
I am currently constructing and sending the email as follows:
$email_sender = "Broker King";
$email_subject = "Thank You For Playing";
$message = "<html>
<body>
<img src='http://www.duncanhall.net/pacmini/logo.jpg' />
<br><br><br>
<font face='tahoma' size='2'>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum eu orci.
Cras non lectus. Fusce tincidunt. Etiam lacinia interdum tellus. Ut mi odio,
rutrum quis, molestie in, lacinia sit amet, sapien. In ultrices lectus in diam.
Vestibulum leo urna, hendrerit ac, facilisis sed, scelerisque ac, enim.
Suspendisse ipsum mi, posuere pellentesque, commodo quis, ultrices et, urna.
Fusce leo. Duis diam.
<br><br>
TEST TEST TEST <b>TEST IN BOLD</b>
<br><br><br>
<b>BROKER KING<b>
</font>
</body>
</html>";
$headers = "MIME-Version: 1.0
";
$headers .= "Content-type: text/html; charset=iso-8859-1
";
$headers .= "From: $email_sender
";
mail("myEmail@someDomain.com", $email_subject, $message, $headers);
This has worked perfectly on the testing server, which is running Apache on a Linux machine. However, on the new server (IIS on Windows), the email simply isn’t sent (and no errors are returned).
I know that it has mail capabilites because I can successfully send simple, standard email from both servers in the form:
<?php
$email_sender = "somebody";
$email_subject = "testing...";
$email_message = "This email will be sent";
mail("myEmail@someDomain.com", $email_subject, $email_message, "From: this@that.net");
?>
Does anyone know of any reason why the first example cannot be sent by both servers?
I would muchly appreciate any help on this.