paulbunyannet / mail
Get message from mail box
dev-master
2015-09-24 21:47 UTC
Requires
- php: >=5.4.0
Requires (Dev)
- fzaninotto/faker: ^1.5
- phpunit/phpunit: ^4.8
- swiftmailer/swiftmailer: ^5.4
This package is auto-updated.
Last update: 2024-11-23 02:52:12 UTC
README
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); }