2

I have to add hyperlink into my mail function. But when there has been sent an email, I dont get the tag, but the fully code like "click here" I just want an email without seeing the tag in my mail. This is the code I am using:

function stuurMail($email, $verificationCode)
{
    $tekst = "";
    $receiver= $email;
    $topic = "Bevestiging aanmelding EenmaalAndermaal";
    $tekst .= "Bedankt voor uw aanmelding!\nOm gebruik te kunnen maken van het platform, dient u via het onderstaande link uw account te activeren!\n";
    $tekst .= "<a href=\"test_functie.php\">http://test.nl/test.php?check=$verificationCode</a>";
    $header = "From: blabla@gmail.com";
    mail($receiver, $topic, $tekst, $header);
}
Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252
Emre
  • 25
  • 5

1 Answers1

3

You should make the email to be a HTML email and not a plain-text one. Update your header this way:

$header = "From: blabla@gmail.com\r\nContent-type: text/html; charset=iso-8859-1";
Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252