PHP Classes

Attaching a zip file

Recommend this page to a friend!

      MIME E-mail message sending  >  MIME E-mail message sending package blog  >  How Can PHP Send Emai...  >  All threads  >  Attaching a zip file  >  (Un) Subscribe thread alerts  
Subject:Attaching a zip file
Summary:I can't seem to figure out how to attach a zip file
Messages:2
Author:Steven
Date:2008-12-06 20:37:39
Update:2008-12-06 21:29:03
 

  1. Attaching a zip file   Reply   Report abuse  
Picture of Steven Steven - 2008-12-06 20:37:39
I looked at the examples, but I can't seem to make it happen.

It would seem to me I would want to file_get_contents, but this does not seem to work.

$attachment=array(
"Data"=>file_get_contents($_SESSION['attachment']),
"Name"=>"pics.zip",
"Content-Type"=>"automatic/name",
"Disposition"=>"attachment"
);
$email_message->AddFilePart($attachment);

  2. Re: Attaching a zip file   Reply   Report abuse  
Picture of Steven Steven - 2008-12-06 21:29:03 - In reply to message 1 from Steven
Never mind. That code works. It helps to have data in the attachment stream.
:o)