2017 © Pedro Peláez
 

library imap-download

Downloader of emails via IMAP

image

granam/imap-download

Downloader of emails via IMAP

  • Thursday, November 9, 2017
  • by jaroslavtyc
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 17 % Grown

The README.md

IMAP email attachments fetcher

Downloads attachment from an email via IMAP, (*1)

Usage

<?php
namespace Heaven\Should\Has\Api;

use Granam\Mail\Download\ImapEmailAttachmentFetcher;
use Granam\Mail\Download\ImapReadOnlyConnection;
use Granam\Mail\Download\ImapSearchCriteria;

$imapConnection = new ImapReadOnlyConnection(
    'light.in.tunnel@example.com',
    'Раѕѕword123',
    'imap.example.com'
);
$fetcher = new ImapEmailAttachmentFetcher($imapConnection, sys_get_temp_dir() /* dir to save attachments */);
$visaFilter = (new ImapSearchCriteria())->filterSubjectContains('Visa');
$attachments = $fetcher->fetchAttachments($visaFilter);

echo 'I have found ' . count($attachments) . ' attachments in emails about Visa to Heaven. Those are: ';
foreach ($attachments as $attachment) {
    echo "\n name: $attachment[name], size " . filesize($attachment['filepath']);
}

NO email body

This library currently does NOT parse email body, therefore it will not give you text of an email. Only attachments., (*2)

MIT licence

This library is released under MIT licence, so do what you want, just do not blame me if something is not perfect., (*3)

The Versions

09/11 2017
09/11 2017

1.0.x-dev

1.0.9999999.9999999-dev https://github.com/jaroslavtyc/granam-imap-download

Downloader of emails via IMAP

  Sources   Download

MIT

The Requires

 

The Development Requires

mail email imap download attachment