Get message from mail box

dev-master 2015-09-24 21:47 UTC

This package is auto-updated.

Last update: 2024-04-23 01:29:57 UTC


README

Build Status Latest Version

paulbunyannet/mail Shortcut for checking a mail box

Installation

This project can be installed via [Composer]:

$ composer require paulbunyannet/mail:"^1.0"

Get Mail

$mailbox = new Pbc\Mail\GetMail([
    'username' => emailUsername,
    'password' => emailPassword,
    'email' => someone@email.com,
    'mailServer' => mail.email.com,
]);

// get total messages in box
$totalMail = $mailbox->getTotalMails();
for ($i = 1; $i <= $totalMail; $i++) {
    $headers = $mailbox->getHeaders($i);
    echo "<h1>" . $headers['subject'] . '</h1>';
    echo "<p>From: " . $headers['from'] . '</p>';
    echo $mailbox->getFullBody($i);
}