在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):Webklex/laravel-imap开源软件地址(OpenSource Url):https://github.com/Webklex/laravel-imap开源编程语言(OpenSource Language):PHP 100.0%开源软件介绍(OpenSource Introduction):IMAP Library for LaravelDescriptionLaravel IMAP is an easy way to integrate both the native php-imap module and an extended custom imap protocol into your Laravel app. This enables your app to not only respond to new emails but also allows it to read and parse existing mails and much more. Official documentation: php-imap.com/frameworks/laravel Discord: discord.gg/jCcZWCSq Table of Contents
Documentations
InstallationThis library requires the sudo apt-get install php*-mbstring php*-mcrypt Installation via composer: composer require webklex/laravel-imap Additional information such as troubleshooting, legacy support and package publishing can be found here: php-imap.com/frameworks/laravel/installation Basic usage exampleThis is a basic example, which will echo out all Mails within all imap folders and will move every message into INBOX.read. Please be aware that this should not be tested in real life and is only meant to gives an impression on how things work. /** @var \Webklex\PHPIMAP\Client $client */
$client = Webklex\IMAP\Facades\Client::account('default');
//Connect to the IMAP Server
$client->connect();
//Get all Mailboxes
/** @var \Webklex\PHPIMAP\Support\FolderCollection $folders */
$folders = $client->getFolders();
//Loop through every Mailbox
/** @var \Webklex\PHPIMAP\Folder $folder */
foreach($folders as $folder){
//Get all Messages of the current Mailbox $folder
/** @var \Webklex\PHPIMAP\Support\MessageCollection $messages */
$messages = $folder->messages()->all()->get();
/** @var \Webklex\PHPIMAP\Message $message */
foreach($messages as $message){
echo $message->getSubject().'<br />';
echo 'Attachments: '.$message->getAttachments()->count().'<br />';
echo $message->getHTMLBody();
//Move the current Message to 'INBOX.read'
if($message->move('INBOX.read') == true){
echo 'Message has ben moved';
}else{
echo 'Message could not be moved';
}
}
} Known issues
SupportIf you encounter any problems or if you find a bug, please don't hesitate to create a new issue. However please be aware that it might take some time to get an answer. Off topic, rude or abusive issues will be deleted without any notice. If you need immediate or commercial support, feel free to send me a mail at [email protected]. A little noticeIf you write source code in your issue, please consider to format it correctly. This makes it so much nicer to read ```php echo 'your php code...'; ``` will turn into: echo 'your php code...'; Features & pull requestsEveryone can contribute to this project. Every pull request will be considered but it can also happen to be declined. Change logPlease see CHANGELOG for more information what has changed recently. SecurityIf you discover any security related issues, please email [email protected] instead of using the issue tracker. CreditsLicenseThe MIT License (MIT). Please see License File for more information. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论