0

In my android app, the user enters his email account and gets in return an email with text in the body. So far so good. However I want to have a link in body of the email,but I don't know how to do it. Here is my code. It is quite simple.

<?php
  require "init.php";
  $email = $_POST['email'];
  $subject = "My subject";
  $txt = "Please visit '<a href='http://www.gazzetta.gr'>Click Here</a>' ";

if($email){
   mail($email,$to,$subject,$txt);
   $don = array('result' =>"success","message"=>"Please check your email    
  account");
  }else{
  $don = array('result' =>"fail","message"=>"email was not entered");
  }
   echo json_encode($don);
 ?>

Any ideas?

Thanks.

Theo
  • 3,099
  • 12
  • 53
  • 94
  • 1
    by default `mail()` uses the content type of `text/plain` so you'd need to set it to `text/html` or build a multi-part email - though, to be honest you could just do `Please visit http://www.gazzetta.gr` and let the email client deal with it if that's the only markup you're using. – CD001 Apr 20 '16 at 15:53
  • You are correct. I will leave it as you suggest it. Thanks! – Theo Apr 20 '16 at 15:56

0 Answers0