I just added a feature to my website which e-mails all Members who have subscribed to an Article Thread (e.g. "Postage Meters Can Save You Money") when other Members post new Comments.

Unfortunately, my test data is not sending me an e-mail.

Here is my e-mail specific code...

PHP Code:
    // ******************************
    // Create New-Comment E-mail.        *
    // ******************************

    
$title 'Re: New comment on "' $articleHeading '" ' rand(51000) . "\n";

    
$body "<p>Dear $subscriberFirstName,</p>\n";
    
$body .= "<p>The user, \"$commenterUsername\", has posted a new comment to the article:<br />\n\t";
    
$body .= "<span class='indent'>\"$articleHeading\"</span>\n";
    
$body .= "<p>To view this article, <a href='/articles/" $articleSlug "'>click here</a></p>\n";
    
$body .= "<p>To view this comment, <a href='/articles/" $articleSlug "#comment_" $commentID "'>click here</a></p>\n";
    
$body .= "<p>Sincerely,<br /><br /><br />\n\n\n";
    
$body .= "<p>Customer Service</p>";

    
$headers  "From: admin@MySite.com <admin@MySite.com\r\n";
    
$headers .= "MIME-Version: 1.0\r\n";
    
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

//echo $subscriberEmail . "<br /><br />";
//echo $title;
//echo $body;
//echo $headers;
//exit();

    
mail($subscriberEmail$title$body$headers); 

When I uncomment the echoes above, I am getting expected values in each variable, so I would expect my e-mail to work?!

I also added a random # to the Subject Line as it makes Gmail less inclined to think this is spam.

**NOTE: I am trying to run this script from my laptop, so I don't have a valid Email/Domain/IP in my Dev Environment, but I haven't really had any issues on a separate script which e-mails me every time there is a System Error, so I would expect this to work as well...

I also tried changing where the test "New Comment" e-mail goes, routing it to my ATT e-mail, thinking it is less picky than Gmail??

Is my code wrong, or am I getting treated as SPAM??

Thanks,


Debbie