yiioverflow / yii2-imap

https://yiioverflow.com
BSD 3-Clause "New" or "Revised" License
41 stars 33 forks source link

getting two result of single file attachment #9

Closed yk134 closed 7 years ago

yk134 commented 7 years ago

I am using https://github.com/unyii2/yii2-imap extension to fetch incoming mails to my web app. it's based on yii2-imap , and facing issue with fetching attachment copies. On my one mail there is only one attachment but when i am parsing it's result array, $imapConnection = new \unyii2\imap\ImapConnection; $imapConnection->imapPath = '{imap.gmail.com:993/imap/ssl}INBOX' ; $imapConnection->imapLogin = 'valid-email-address' ; $imapConnection->imapPassword = 'password' ; $imapConnection->serverEncoding = 'utf-8' ; $imapConnection->attachmentsDir = 'Directory location' ; $mailbox = new \unyii2\imap\Mailbox( $imapConnection ) ; $mailIds = $mailbox->searchMailBox( UNSEEN ) ;

foreach( $mailIds as $mailId ) { $mail = $mailbox->getMail( $mailId ) ; $mailbox->readMailParts = false; $mail = $mailbox->getMailParts( $mail ) ; $attachments = $mail->getAttachments(); }

Here i am getting two copy of attachments for single email but actually there is only one attachment.

can any one help out for this ?

yiioverflow commented 7 years ago

Fixed