Help with custom mail()

Hey I have following problem,
I am trying to use a .html file as a template for php mail() function.

I wanted to change certain segements of the .html to make it a custom message.
Here is the code:

$mails = fopen(“cssmail.html”,“r”);
$mails = stream_get_contents($mails, -1);

$tochange = array("#USERNAME#","#PASSWORD#","#MAILADDR#","#ACTVTURL#");
$change = array("$user_name","$pass","$mail","$activate_url");
$edited = str_replace($tochange,$change,$mails);
$mail_subject = “Night In Sight Account Confirmation”;
$mail_body = “$edited”;
$headers = ‘MIME-Version: 1.0’ . “\r\n”;
$headers .= ‘Content-type: text/html; charset=iso-8859-1’ . “\r\n”;
$headers .= “From: [email protected]”;
echo “Problem with sending email!”;
Now the problem is I get the Result “Problem with sending email” which is a check, and tells me that the $mails is empty, but I filled it with all the necessary variables. What am I doing wrong’ :o

Thank you for all answers in advance :slight_smile:

oh I forgot to mention that I am using and that they have a setting to set the smtp server
I have it set to my own e-mail adress which is

Sponsor our Newsletter | Privacy Policy | Terms of Service