PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 10.0.1
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v10.0.1
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
acymailing / vendor / javanile / php-imap2 / src / ImapHelpers.php

ImapHelpers.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress 10.0.1, at vendor/javanile/php-imap2/src/ImapHelpers.php

36 lines 735 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3
4 namespace Javanile\Imap2;
5
6 class ImapHelpers
7 {
8 public static function idToUid($imap, $messageNums)
9 {
10 $client = $imap->getClient();
11
12 $messages = $client->fetch($imap->getMailboxName(), $messageNums, false, ['UID']);
13
14 $uid = [];
15 foreach ($messages as $message) {
16 $uid[] = $message->uid;
17 }
18
19 return implode(',', $uid);
20 }
21
22 public static function uidToId($imap, $messageUid)
23 {
24 $client = $imap->getClient();
25
26 $messages = $client->fetch($imap->getMailboxName(), $messageUid, true, ['UID']);
27
28 $id = [];
29 foreach ($messages as $message) {
30 $id[] = $message->id;
31 }
32
33 return implode(',', $id);
34 }
35 }
36