Webmail with Attach
| From: | Luz Lopez | Date: | Tue, 08 Jan 2002 22:49:07 +0000 |
| Subject: | Webmail with Attach | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-79826@lists.php.net to get a copy of this message | ||
Hi All,
I am making a webmail, this webmail can send with just one attach, but I need that that my webmail can send mail with many attach.
Now my function have the follwing code line:
if ($attach != "none")
{
$file = fopen($attach, "r");
$contents = fread($file, $attach_size);
$encoded_attach = chunk_split(base64_encode($contents));
fclose($file);
//$encoded_attach = base64_encode($attach);\
//$encoded_attach = $attach;
$mailheaders .= "MIME-version: 1.0\n";
$mailheaders .= "Content-type: multipart/mixed; ";
$mailheaders .= "boundary=\"Message-Boundary\"\n";
$mailheaders .= "Content-transfer-encoding: 7BIT\n";
$mailheaders .= "X-attachments: $attach_name";
$body_top = "--Message-Boundary\n";
$body_top .= "Content-type: text/plain; charset=US-ASCII\n";
$body_top .= "Content-transfer-encoding: 7BIT\n";
$body_top .= "Content-description: Mail message body\n\n";
$msg_body = $body_top . $msg_body;
$msg_body .= "\n\n--Message-Boundary\n";
$msg_body .= "Content-type: $attach_type; name=\"$attach_name\"\n";
$msg_body .= "Content-Transfer-Encoding: BASE64\n";
$msg_body .= "Content-disposition: attachment; filename=\"$attach_name\"\n\n";
$msg_body .= "$encoded_attach\n";
$msg_body .= "--Message-Boundary--\n";
}
How can I do it?
Some body can help me?
Thanks in Advanced,
Regards,
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com