Daanvn
Daanvn

Reputation: 1266

Link in PHP mail does not send the right link

I am sending a mail with php and I have included a link using this code:

$message = "--{$mime_boundary}\n" . "Content-Type: text/html; charset=\"iso-8859-1\"\n"."Content-Transfer-Encoding: 7bit\n\n" . $message . "\n\n";
$message .= "<a href='www.stackoverflow.com'>Click.</a>\n\n";

The link does get sent in the email but when I click on the link in Outlook it will open in IE and it goes to res://ieframe.dll/syntax.htm#www.stackoverflow.com instead of the www.stackoverflow.com.

However when I hover my mouse over the link it will show the correct link on the bottom of the page, take a look at this:

enter image description here

(The printscreen removes the mouse but in the pic I was hovering my mouse on the link.)

Is there something wrong with my code or could this be an Outlook issue? If anyone knows what could be wrong it would be great!

Upvotes: 0

Views: 133

Answers (1)

Tim Withers
Tim Withers

Reputation: 12059

You are missing the http:// before the link.

Otherwise it will be appended to the end of the current url.

Upvotes: 3

Related Questions