Hyperlinks do not work in email sent from PHP?

Will

New member
I have been struggling with it for a while now. I am sending the email in html format and I think the links should work but it does not. I am using the link to enable user to check his add.

The problem is that the link part does not work but they 'do' appear as link but does not open anything. It is like plain text which looks like a blue link. Do i need anything special. Here is a brief snippet of my code
<?
$to = "[email protected] \r\n";
$sub = "This is my subject";
$msg = "<html><head><title></title></head><body>this is message body, click this link to activate your membership
<a href=\"www.mydomain.com\activate\" target=\"_blank\"> my link </a> </body></html>";
$header = "From: [email protected]"."\r\n";
$header .= "MIME-Version: 1.0 \r\n";
$header .= "Content-type: text/html \r\n";

// now send the mail
mail($to,$sub,$msg,$header);
?>

what is wrong that the link do not work? The email is send with proper html body. Am i doing something wrong with <a href= tag?

One other problem that i should mention is the From: does not say my chosen address. Rather it says the isp name from where it was sent. If i omit extra headers and leave only From: [email protected], then it correctly says it was sent from this email address. Please help.
 
Back
Top