Jump to content

email attachment is 0k??????


dflow

Recommended Posts

hi

 

im using MIME for mailing and email with a html file

 

the mail is sent but the file is 0k and empty of course

 

 

wht is wrong?

 

here is the script im using:

<?php $mime_boundary = "<<<--==+X[".md5(time())."]";

 

$headers .= "From: Automatic <[email protected]>\r\n";

$headers .= "To: SomeName <[email protected]>\r\n";

 

 

$headers .= "MIME-Version: 1.0\r\n";

$headers .= "Content-Type: multipart/mixed;\r\n";

$headers .= " boundary=\"".$mime_boundary."\"";

 

$message .= "This is a multi-part message in MIME format.\r\n";

$message .= "\r\n";

$message .= "--".$mime_boundary."\r\n";

 

 

 

$message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n";

$message .= "Content-Transfer-Encoding: 7bit\r\n";

$message .= "\r\n";

$message .= "Email content and what not: \r\n";

$message .= "This is the file you asked for! \r\n";

$message .= "--".$mime_boundary."\r\n";

 

 

 

$message .= "Content-Type: application/htm;\r\n";

$message .= " name=\"test.htm\"\r\n";

$message .= "Content-Transfer-Encoding: quoted-printable\r\n";

$message .= "Content-Disposition: attachment;\r\n";

$message .= " filename=\"test.htm\"\r\n";

$message .= "\r\n";

$message .= $fileContent;

$message .= "\r\n";

$message .= "--".$mime_boundary."\r\n";

 

$ok = mail("[email protected]", "file by email", $message, $headers);?>

 

thx

Link to comment
https://forums.phpfreaks.com/topic/111169-email-attachment-is-0k/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.