2017 © Pedro Peláez
 

library php-imap

Get email contents and attachments using php imap extension.

image

haogood/php-imap

Get email contents and attachments using php imap extension.

  • Wednesday, March 21, 2018
  • by Haogood
  • Repository
  • 0 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 3 Versions
  • 33 % Grown

The README.md

Author Release Software License Size, (*1)

Requirements

  • PHP >= 5.5.0
  • IMAP PHP Extension

Installation

composer require haogood/php-imap

Initialize

use IMAP\IMAPMailbox;
$host = '{imap.gmail.com:993/imap/ssl}';
$user = 'user@gmail.com';
$pwd = '******';
$mailbox = new IMAPMailbox($host, $user, $pwd);
$emails = $mailbox->search('ALL');

Fetch header info

foreach ($emails as $email) {

    // Header info
    $headerinfo = $email->fetchHeaderinfo();

    // Author
    $author = $headerinfo->from->personal;

    // Sender address
    $from = $headerinfo->from->mailbox.'@'.$headerinfo->from->host;

    // Timestamp
    $timstamp = $headerinfo->udate;

    // Contents
    $contents = $email->getBody();

}

Fetch attachments

foreach ($emails as $email) {
    foreach($email->getAttachments() as $attachment) {

        // Filename
        $filename = $attachment->getFilename();

        // Extension
        $ext = $attachment->getExtension();

        // Attachment file
        $file = $attachment->getBody();

        // Attchment info
        $info = $attachment->getInfo();

    }
}

Reference

License

haogood/php-imap is licensed under The MIT License (MIT)., (*2)

The Versions

21/03 2018

dev-master

9999999-dev

Get email contents and attachments using php imap extension.

  Sources   Download

MIT

The Requires

  • php >=5.5.0
  • ext-imap *

 

by Benny Sun

php imap pop3 mailbox receive emails

15/03 2018

v1.0.1

1.0.1.0

Get email contents and attachments using php imap extension.

  Sources   Download

MIT

The Requires

  • php >=5.5.0
  • ext-imap *

 

by Benny Sun

php imap pop3 mailbox receive emails

15/03 2018

v1.0.0

1.0.0.0

Get email contents and attachments using php imap extension.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

by Benny Sun