Open File And Send With E-mail
Posted: Mon Nov 18, 2002 8:26 am
Hi,
I have this script:
In the bottom you see a code that includes the HTML from the file that it read at the top. The variable that keeps the info is $content. Content have to be included with the mail. Why want the $content come with the mail? I tried to remove the header in the bottom and replace it with
After the mail was sent it then printet $content and the info came up in the browser. But the mail that was sent didnt have the info from $content in it at all.
I have this script:
Code: Select all
<?php
if( $_POSTї'navn']=="" or $_POSTї'adresse']=="" or $_POSTї'postnummer']=="" or $_POSTї'sted']=="" or $_POSTї'telefon']=="" or $_POSTї'betaling']=="" )
{
header( "Location: tilkassen_tommefelt.php" );
exit;
}
$fp = fopen("brukere/".$_POSTї'brukernavn'].$_POSTї'passord'].".php", "r");
$content = fread($fp,filesize("brukere/".$_POSTї'brukernavn'].$_POSTї'passord'].".php"));
fclose($fp);
//MAIL TIL WEBSHOP DRIFTER
$to = "zeceer@hotmail.com";
$subject = "Webshop Bestilling";
$headers = "zeceer@hotmail.com";
$body = "
<br>
<br>
Navn: ".$_POSTї'navn']."
<br>
Adresse: ".$_POSTї'adresse']."
<br>
Postnummer: ".$_POSTї'postnummer']."
<br>
Sted: ".$_POSTї'sted']."
<br>
Telefon: ".$_POSTї'telefon']."
<br>
E-mail: ".$_POSTї'email']."
<br>
<br>
<b>Betaling:</b> ".$_POSTї'betaling']." ".$_POSTї'kortnummer']." - ".$_POSTї'kortdato']."
<br>
<br>".
"
<html>
<body>
$content
</body>
</html>";
mail($to,$subject,$body,"Content-type: text/html; charset=iso-8859-1\r\n");
header( "Location: index.php" );
?>Code: Select all
print("$content");