我在OS X El Capitan上使用PHP 7.2,使用Homebrew(当然)安装.现在我想使用PHP的IMAP扩展中的一些IMAP函数,但无论我搜索什么,我都找不到在OSX上添加扩展的方法.
我尝试过的一些事情......当然,我尝试过最常用的方法:
$ brew reinstall php --with-imap
Run Code Online (Sandbox Code Playgroud)
然而,这失败了,回归:
Warning: php: this formula has no --with-imap option so it will be ignored!
Run Code Online (Sandbox Code Playgroud)
我在传递中提到的另一种方法也失败了:
$ brew install php72-imap
Error: No available formula with the name "php72-imap"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No …Run Code Online (Sandbox Code Playgroud) 我设计了 laravel 应用程序来使用 php imap 获取邮件。在内核中我编写了代码来获取所有邮箱,下面是我从邮箱获取邮件的代码
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Illuminate\Http\Request;
use App\Models\Email;
use App\Models\Inbox;
use App\Models\Spam;
use App\Models\Sent;
use App\Models\Drafts;
use App\Models\Trash;
use App\Models\Junk;
use App\Models\Attachments;
use App\Models\Errorlogs;
use PhpImap\Mailbox as ImapMailbox;
use PhpImap\IncomingMail;
use PhpImap\IncomingMailAttachment;
class Kernel extends ConsoleKernel
{
protected $commands = [
//
];
public function saveMail($result,$mailboxType,$mailbox,$stream,$j,$accountId,$appUrl)
{
$i=0;
while(1)
{
try
{
if(isset($result[$i]))
{
$mail=$mailbox->getMail($result[$i],false);
$status = imap_headerinfo($stream,$j);
$status = ( $status->Unseen == 'U') ? 'unread' : 'read';
if($mailboxType=="Inbox") …Run Code Online (Sandbox Code Playgroud)