Currently seeking new career opportunities in web development, particularly with Laravel, Hire Me
Imap

Introduction

IMAP class for reading IMAP emails with PHP

Example usage:

use Dcblogdev\Imap\Imap;

//set search criteria
$date = date('d-M-y', strtotime('1 day ago'));
$term = 'ALL UNDELETED SINCE "'.$date.'"';

//ignore array of emails
$exclude = [];

$email    = 'someone@domain.com';
$password = 'emailpassword';
$host     = 'outlook.office365.com';//your email host
$port     = '993';//port number
$savePath = "emails";//folder to save attachments
$delete   = false;//set to true to delete email

//initialise email
$imap = new Imap($email, $password, $host, $port, 'Inbox', $savePath, $delete);

//get emails pass in the search term and exclude array
$emails = $imap->emails($term, $exclude);
Laravel Modules Your Logo Your Logo Your Logo

Become a sponsor

Help support the blog so that I can continue creating new content!

Sponsor

My Latest Book

Modular Laravel Book - Laravel: The Modular way

Learn how to build modular applications with Laravel Find out more

Subscribe to my newsletter

Subscribe and get my books and product announcements.

Learn Laravel with Laracasts

Faster Laravel Hosting

© 2006 - 2024 DC Blog. All code MIT license. All rights reserved.