Can someone please help me! I am going insane......
I am trying to execute the mail() function on a windows server, and when I use the simple version:
there are no problems, but the moment that I use the additional headers parameter it doesn't work...... here is my code:
By the way the "\n" or "\n\r" issue is not to blame - as I have tried both......
Please help!
A computer always does what you tell it to, but rarely does what you want it to.....
I am trying to execute the mail() function on a windows server, and when I use the simple version:
Code:
mail("address@domain.com","SUBJECT","MESSAGE");
there are no problems, but the moment that I use the additional headers parameter it doesn't work...... here is my code:
Code:
<?php
// subject
$subject = 'Testing mail function';
// message
$message = '
<html>
<head>
<title>HTML TEST</title>
</head>
<body>
<p>HTML TEST!</p>
</body>
</html>
';
$delimeter = "\r\n";
// To send HTML mail, the Content-type header must be set
$headers = "MIME-Version: 1.0".$delimeter;
$headers .= "Content-type: text/html; charset=utf-8".$delimeter;
$headers .= "From: $from".$delimeter;
$headers .= "Reply-To: $from".$delimeter;
$headers .= "Cc: $cc".$delimeter;
// Mail it
if (mail($to, $subject, $message, $headers)) {
echo "E-mail sent.";
} else {
echo "ERROR! Can't send e-mail.";
}
?>
By the way the "\n" or "\n\r" issue is not to blame - as I have tried both......
Please help!
A computer always does what you tell it to, but rarely does what you want it to.....