Jump to content

ATTACH A ZIP FILE IN AN EMAIL


philjoshua

Recommended Posts

Hi, I'm just new with PHP. Can someone help me or give me advise about attaching a zip file with the form to be sent on email?

 

Is it like,

$fp = fopen($file,"rb");

$fcontent = fread($fp ,filesize($file));

fclose($fp);

$content = chunk_split(base64_encode($fcontent));

$sep = strtoupper(md5(uniqid(time())));

$name = basename($file);

 

but when I tried this, it returns a Warning: fread(): supplied argument is not a valid stream resource. ???

Thanks ;)

Link to comment
https://forums.phpfreaks.com/topic/144444-attach-a-zip-file-in-an-email/
Share on other sites

have a look at this pear package http://pear.php.net/package/Mail_Mime it is well documented and has support for adding attachments

 

Scott.

 

Hi, I just want to ask how about if my form has a form confirmation, how will the attachment be detected or included on the confirmation page?  ??? thanks

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.