excel - I can't get the attachement of the email PHP -
i have script connect imap , excel files. worked till today. 1 of our supplier script can't attached file. think there wrong decoding email.
this code decoding
if($attachments[$i]['is_attachment']) { $attachments[$i]['attachment'] = imap_fetchbody($this->_mbox,$email_number,$i); /* 4 = quoted-printable encoding */ if($flattenedparts[$i]->encoding == 3) { $attachments[$i]['attachment'] = base64_decode($attachments[$i]['attachment']); } elseif($flattenedparts[$i]->encoding == 4)/* 3 = base64 encoding */ { $attachments[$i]['attachment'] = quoted_printable_decode($attachments[$i]['attachment']); } }
is there other ways decode email imap on php?
the array of imap
array ( [1] => stdclass object ( [type] => 0 [encoding] => 0 [ifsubtype] => 1 [subtype] => plain [ifdescription] => 0 [ifid] => 0 [lines] => 38 [bytes] => 431 [ifdisposition] => 0 [ifdparameters] => 0 [ifparameters] => 1 [parameters] => array ( [0] => stdclass object ( [attribute] => charset [value] => us-ascii ) ) ) [2] => stdclass object ( [type] => 3 [encoding] => 3 [ifsubtype] => 1 [subtype] => ms-tnef [ifdescription] => 0 [ifid] => 0 [bytes] => 3584988 [ifdisposition] => 1 [disposition] => attachment [ifdparameters] => 1 [dparameters] => array ( [0] => stdclass object ( [attribute] => filename [value] => winmail.dat ) ) [ifparameters] => 1 [parameters] => array ( [0] => stdclass object ( [attribute] => name [value] => winmail.dat ) ) )
)
Comments
Post a Comment