Posted by nescio on 02/13/06 21:31
hello,
i have to make some csv-files from a database.
then i zip the csv-files (i zip the directory and the files in the
directory)
then i have to sent the zip-files as an attachment with an email.
i found out how to make an zip file on the fly but the problem is: i don't
know how to get it as
an attachment to the email.
i found some sample code but it doesn't work.
the problem is: i don't know what kind of content-type i have to use with a
zip file
i tried something as: Content-Type: application/zip; but this doesn't work.
------------------ source code ---------------------
# Attachment
$msg .= "--".$mime_boundary.$eol;
$msg .= "Content-Type: application/zip; name=\"".$letter."\"".$eol; //
sometimes i have to send MS Word, use 'msword' instead of 'pdf'
$msg .= "Content-Transfer-Encoding: base64".$eol;
$msg .= "Content-Disposition: attachment;
filename=\"".$letter."\"".$eol.$eol; // !! This line needs TWO end of lines
!! IMPORTANT !!
$msg .= $f_contents.$eol.$eol;
# Setup for text OR html
$msg .= "Content-Type: multipart/alternative".$eol;
----------------------------------------------------------
thanks
Navigation:
[Reply to this message]
|