![]() The reason 1 is added to $i in the call to imap_fetchbody() is that the parts are zero-based but in the IMAP functions they are one-based. This is achieved with the following code, assigning information to a array called $attachments. If the part doesn’t have a name then it’s not an attachment. imapbody (mbox,mid) // simple // Any part may be encoded, even plain text messages, so check everything. ![]() As I understand the properties lazy fetched from DataPartInfo containing encoding property. My question is related to textPlain and textHtml properties of IncomingMail class. ![]() The package is easy to use and works like a charm. You can see we need to loop through and then each part’s and to get the filename and name for each, downloading the message part using imap_fetchbody() if it is. 7.4 Type of execution: CLI Thank you for your work. The above isn’t the easiest to extract the information we need. 1.1 - TEXT/PLAIN 1.2 - TEXT/HTML 2 - file.ext Now if you attach the above email to an email with the message text in plain text and HTML, imapfetchbody() will use this type of part number system: (empty) - Entire message 0 - Message header 1 - MULTIPART/ALTERNATIVE 1.1 - TEXT/PLAIN 1. Get message body and attachments using PHP IMAP Original function I will at some point in the future refine this function to put the plain text body, html body and attachments into separate parts of the array but for the present work I simply need to get the attachments from the email and the body can be ignored.
0 Comments
Leave a Reply. |