There arise some situations when we send a mail using php with HTML content and the Receiver's mail client only supports text mail then the html content will be displayed with Tags.
To solve this issue we need to send both HTML and Text content with the mail.So that the matter will be displayed according to the Mail client.
This should be practiced so that no issues occurs in the future.
The script to use is added below.
$boundary = "nextPart";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "From: Me <sales@mysite.com>\r\n";
$headers .= "Content-Type: multipart/alternative; boundary = $boundary\r\n";
//text version
$headers .= "\n--$boundary\n"; // beginning \n added to separate previous content
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "This is the plain version";
//html version
$headers .= "\n--$boundary\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "This is the <b>HTML</b> version";
mail("test@techwyseintl.com", "An HTML Message", "", $headers); //NB:-There is no need to pass the body content as we regularly do since its already added in the headers.