Jump to content

PHP Imap functions / parts


Nodral

Recommended Posts

Morning All

 

I'm in the process of creating an email app, and I'm having an issue extracting anything useful from a certain email.  99.99% of emails received work absolutely fine, however I cannot get any content from one.

 

The structure returned from

$structure = imap_fetchstructure($MailboxConnection, $email_number, 0);

is

object(stdClass)#5 (11) {  ["type"]=>  int(1)  ["encoding"]=>  int(0)  ["ifsubtype"]=>  int(1)  ["subtype"]=>  string(5) "MIXED"  ["ifdescription"]=>  int(0)  ["ifid"]=>  int(0)  ["ifdisposition"]=>  int(0)  ["ifdparameters"]=>  int(0)  ["ifparameters"]=>  int(1)  ["parameters"]=>  array(1) {    [0]=>    object(stdClass)#6 (2) {      ["attribute"]=>      string( "boundary"      ["value"]=>      string(33) "--_com.android.email_313497894392"    }  }  ["parts"]=>  array(1) {    [0]=>    object(stdClass)#7 (12) {      ["type"]=>      int(0)      ["encoding"]=>      int(3)      ["ifsubtype"]=>      int(1)      ["subtype"]=>      string(4) "HTML"      ["ifdescription"]=>      int(0)      ["ifid"]=>      int(0)      ["lines"]=>      int(26)      ["bytes"]=>      int(2068)      ["ifdisposition"]=>      int(0)      ["ifdparameters"]=>      int(0)      ["ifparameters"]=>      int(1)      ["parameters"]=>      array(1) {        [0]=>        object(stdClass)#8 (2) {          ["attribute"]=>          string(7) "charset"          ["value"]=>          string(5) "utf-8"        }      }    }  }}

Which part should I extract with

$data = imap_fetchbody($MailboxConnection, $email_number, '????');

Been on this for a while now, and getting nowhere fast so any help would be greatly appreciated.  I've read the documentation, but it doesn't go into detail of identifying what part can be identified and extracted from the stucture information.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.