public function saveAttachmentsMessagesBySubject($subject, $dir = null, $charset = null)
    {
        $criteria = 'SUBJECT "'.$subject.'"';
        $ids = imap_search($this->imap, $criteria, null, $charset);
        if(!$ids){
            throw new ImapClientException('Messages not found. Or this criteria not supported on your email server.');
        };
        foreach ($ids as $id) {
            $this->getMessage($id);
            if(isset($dir)){
                $dir = ['dir'=>$dir];
            };
            $this->saveAttachments($dir);
        };
    }
public function saveAttachmentsMessagesBySubject($subject, $dir = null, $charset = null)
    {
        $criteria = 'SUBJECT "'.$subject.'"';
        $ids = imap_search($this->imap, $criteria, null, $charset);
        if(!$ids){
            throw new ImapClientException('Messages not found. Or this criteria not supported on your email server.');
        };
        foreach ($ids as $id) {
            $this->getMessage($id);
            if(isset($dir)){
                $dir = ['dir'=>$dir];
            };
            $this->saveAttachments($dir);
        };
    }
public function saveAttachmentsMessagesBySubject ( $ subject , $ dir = null , $ charset = null ) { $ criteria = 'SUBJECT "' . $ subject . '"' ; $ ids = imap_search ( $ this -> imap , $ criteria , null , $ charset ) ; if ( ! $ ids ) { throw new ImapClientException ( 'Messages not found. Or this criteria not supported on your email server.' ) ; } ; foreach ( $ ids as $ id ) { $ this -> getMessage ( $ id ) ; if ( isset ( $ dir ) ) { $ dir = [ 'dir' => $ dir ] ; } ; $ this -> saveAttachments ( $ dir ) ; } ; }
Save Attachments Messages By Subject

@param string $subject
@param string $dir for save attachments
@param string $charset for search
@return void
@throws ImapClientException
Save Attachments Messages By Subject