Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Attachments

Status
Not open for further replies.

ronnyjljr

IS-IT--Management
Joined
Nov 23, 2003
Messages
249
Location
US
Ok, PHP documentation is extremely unclear on how to interpret e-mail messages. I want to find out whether the document has an attachment or not. By sending myself various e-mails and checking the numbers that show up I have come up with this code:

$message_structure = imap_fetchstructure($pop_connect,$i);
$count = count($message_structure->parts);
if ($count>1) $attach="Yes";
else $attach = "No";

I believe this is correct to some extent because when I sent images as attachment I would get the number 2, and plain text was just 0. and More than one image would just make the number go up for each image.
Am I on the right path?

Can anybody verify this?

Thanks,
Ron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top