# Trouble sending html through email with php

**URL:** <https://forum.kirupa.com/t/trouble-sending-html-through-email-with-php/126646>\
**Category:** Uncategorized\
**Created:** [October 26, 2004, 4:05am UTC](https://forum.kirupa.com/t/trouble-sending-html-through-email-with-php/126646 "2004-10-26T04:05:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![KaZ](https://avatars.discourse-cdn.com/v4/letter/k/ecd19e/32.png) [@KaZ](https://forum.kirupa.com/u/KaZ)\
**Post date:** [October 26, 2004, 4:05am UTC](https://forum.kirupa.com/t/trouble-sending-html-through-email-with-php/126646/1 "2004-10-26T04:05:43Z")

</div>

I currently have set up a template html page to email out to users, problem is that when i send it it puts “/” in front of all the " 's and breaks the links and images any way to change this here is partial code.

\<?php  
if (file\_exists(“email-template/email.html”)) {  
$tpl = htmlspecialchars(implode("", file(“email-template/email.html”)));  
}  
$to = “$too”;  
$from = “test@blah[.com](mailto:rates@velardemortgage.com)”;  
$subject = “$sub”;  
$message = “$tpl”;  
$headers = "From: $from  
";  
$headers .= "Content-type: text/html  
";  
$success = mail($to, $subject, $message, $headers);  
if ($success)  
echo “The email to $to from $from was successfully sent”;  
else  
echo “An error occurred when sending the email to $to from $from”;  
?\>

oh $tpl is being displayed in a textarea so user can update/view what he is sending  
i also have it pulling the html from a mysql database so i tryed this pulling template method both seem to mail with the / 's before all the " 's i also tryed renaming all the " 's to teir respected name &bla; name still had an issue  
any help would be most appreciative.
