..... with a . as these get interpreted as newline/carriage return characters when the mail is sent. You only need to use the . operand when joining vars, etc, when in php, or adding vars to echo strings.
In a
command line mail application such as pine, etc., or when directly communicating with a mail program (e.g., not using mail(),) a
bare period on a line by itself, like
print '.';
is an end of message indicator, telling the mail program to flush the buffer and send the mail.
THE PHP Exception, for Windblows servers [php.net]:
Caution
(Windows only) When PHP is talking to a SMTP server directly, if a full stop is found on the start of a line, it is removed. To counter-act this, replace these occurrences with a double dot.
<?php
$text = str_replace("\n.", "\n..", $text);
?>
Try running this, tell me what you get - or maybe you already know. :-)
<?php
header("content-type:text/html");
$verb="jumped";
$canine='dog';
echo "The quick " . ' brown fox ' . $verb . " over " . ' the ' . "lazy $canine" . '.';
?>
Although the quoting switches in the original code are indeed unnecessary, the effect of the two versions are synonymous.
In addition to Penders' suggestion (which may or may not help,) note that
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
You are declaring the mail content-type as html, I have seen SpamAssassin flag points for (paraphrased) "content-type declared as html, no html found in message." So try
$message= "
<html><head><title>$subject</title></head></body>
<p>$message</p>
</body>
</html>
";
... before the send. Don't worry, the code won't appear in the email. It's not likely to help with hotmail, but you never know, it might, and does help on some recipient servers.
Make sure your SPF records are set up properly for the sending site . . . every little bit helps.
Also it may just be that your message is too short. I've no idea if that has anything to do with it, but put a few lines in there to make sure it's not being killed just because it's too close to an empty message.
Last stab, make sure the to and from are different domains, even this can trigger spam-boxing sometimes. That is, make the to from your gmail account, the from from your example.com account.