How to Embed HTML code inside email using PHP

60 Views Asked by At

I want to include an html meta tag inside an email which we are sending using PHP.

<meta name=\"yyyy\" content=\"uuuuu\" />

I'm expecting the email like:

Hello,

Thank you for subscribing. Please include the below code in <head>

<meta name=\"yyyy\" content=\"uuuuu\" />

Thanks & Regards,

yy

What is the best way to include html code inside email which will work for all email servers like Gmail, Outlook etc.

Thanks in advance.

1

There are 1 best solutions below

2
On BEST ANSWER

This is the function you need :

$codeValue = htmlspecialchars("<meta name=\"yyyy\" content=\"uuuuu\" />");

This way the code won't be interprated