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:
[table]
[tr]
[td]$user_name="$firstname";
$activate_url=“http://nightinsight.co.de/activation.php?id=$id&sequence=$db_password”;
$pass="$pass1";
$mailrec="$email1";

$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]”;
$suc=mail($user_email,$mail_subject,$mail_body,$headers);
if(!$suc)
{
echo “Problem with sending email!”;
}
fclose($mails);[/td]
[/tr]
[/table]
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 kilu.de and that they have a setting to set the smtp server
I have it set to my own e-mail adress which is smtp.live.com

Sponsor our Newsletter | Privacy Policy | Terms of Service