> How can I check to see if a email has an attachment?  Then download it if the 
> user clicks on it?

I've been working on a webmail for POP3 but I guess the idea is about the same.

To check if a an email has attachments you use the function imap_fetchstructure() and 
then you can do something like this:

$struc = imap_fetchstructure();
count($struc->parts);
if ($no_of_parts > 0) {
echo "the message has attachments.";
}

This is my way of doing it, the 'bad' thing with this kind of code is that it also 
includes HTML-messages. This can be prevented with some extra code though.

For downloading you use the same kind of thing, I guess it slightly more advanced and 
you have to do some decoding of the message.

Best regards,

Jome

(looking for php-jobs, coding for $15/hour)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to