views:

59

answers:

2

I am trying to send notification emails(which is working fine) but have added the html headers to try to send links etc...for some reason nothing is showing up at all, just blank space where the desired links are supposed to be. Here is my code:

if(isset($_POST['commentBlogSubmit']) && $auth) {

    $query = "SELECT `Email` FROM `Users` WHERE `id` = '" . $prof->id . "'";
    $request = mysql_query($query,$connection) or die(mysql_error());
    $result = mysql_fetch_array($request); 

    $Email = $result['Email'];


    $to = $Email;
    $subject = "Someone sent you left you a comment";
    $message = "You have a new blog comment  <br />".
               " <a href='http:www.blah.org/indexNew.php'></a>";
    $from = "[email protected]";
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers .= "From: $from";
    mail($to, $subject, $message, $headers);

}
+10  A: 

Perhaps because you have no text inside the link tag?

Boldewyn
Yeah, probably ;)
DaNieL
duh! I can't believe I missed that! Thanks!
Ralph The Mouf
You're welcome!
Boldewyn
And after all: It's monday (at least in my part of the world). You're excused ;-).
Boldewyn
Ha ha, I love mistakes like this. I do them all the time, it's nice to see that someone else's brain isn't working on a Monday either :-)
Topher Fangio
Haha this might be my fav question of the day.
Question Mark
A: 

Because the PHP email function generally sends plain text.

Rather than trying to do this yourself, you should probably use Mail_Mime

Also, though your headers are probably correct, you have nothing between the <a> and </a> tags.

Mez
Why the downvotes?
Mez