Mail with attachment
Posted: Mon Aug 16, 2004 12:26 pm
hi this is the code i'm using
I do not get any "text" displayed BUT i do have the "attachment" sign (in outlook) next to the email, but i don't see any file actually attached to it..
I don't know nothing about attachment in emails... but i didn't want to use phpmailer.
Any help would be appreciated
Code: Select all
<?php
<?php
$piece = $_POST["piece"];
$email = $_POST["email"];
$serie = $_POST["serie"];
$msg = $_POST["msg"];
$warranty = $_POST["warranty"];
$destinataire = $_POST["destinataire"];
$boundary = "kader-12345";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: multipart/mixed; boundary="$boundary"";
"--$boundary";
$headers .= "Content-Type: text/plain; charset="iso-8859-1"";
$headers .= "Content-Transfer-Encoding: 7bit";
$to = "$email";
$subject = "LPG Canada";
$message = "
<html>
<head>
<title>LPG Canada</title>
</head>
<body>
Hi i'm sending you\n\n
<br /><br />
<b>Piece :</b>$piece\n<br />
<b>serial number :</b> $serie\n<br />
<b>Warranty :</b> $warranty\n\n<br /><br />
<b>The reasons are the follwing :</b>\n<br />
$msg
</body>
</html>
";
"--$boundary";
$headers .= "Content-Type: image/jpeg; name="../file.txt"";
$headers .= "Content-Transfer-Encoding: base64";
$headers .= "Content-Disposition: attachment";
$headers .= "<base64 encoded data for the zendlogo.jpg image>";
"--$boundary--";
$headers .= "To: <$destinataire>\n";
$headers .= "From: <$email>\n";
if (mail($to, $subject, $message, $headers)) {
echo("<br /><br /><br /><center>Merci<br /><a href="../index.php">Accueil</a></center><br />");
} else {
echo("<center>Erreure, veuillez <a href="javascript:history.back();">cliquer ici</a> et recommencer</center>");
}
?>I don't know nothing about attachment in emails... but i didn't want to use phpmailer.
Any help would be appreciated