php imap_search功能具有digitalocean液滴不起作用
我正在为我的CodeIgniter应用程序使用PHP(PHP7.2)IMAP_SEREARZ函数,该应用程序与Outlook Mail连接,
在配置文件中给出了用户名和HostName,
Mailbox_hostname={outlook.office365.com:993/imap/ssl/novalidate-cert/[email protected]}
[email protected]
Mailbox_password=xxxxx
控制器代码看起来像下面,
$imap_resource = imap_open($mailbox, $username, $password);
$search_sender = '[email protected]';
$search = 'FROM "' . $search_sender . '" ON "06 April 2022"';
$emails = imap_search($imap_resource, $search);
此代码部署到两个服务器(登台和生产)该托管在Digitalocean液滴中。 这可以在分期和$电子邮件返回时起作用
Array
(
[0] => 3652
[1] => 3659
)
,但在生产服务器上不起作用。它给出了空的响应。
是否有在服务器端检查或配置任何特定的邮件设置以使此操作?还是可能引起问题的任何防火墙?
注意:-IMAP_OPEN有效,我正确地获取了IMAP资源ID,但是IMAP_SEREARH只会失败。
I am using PHP(php7.2)imap_search function for my Codeigniter application which connects with outlook mail,
In Config file the username and hostname are given,
Mailbox_hostname={outlook.office365.com:993/imap/ssl/novalidate-cert/[email protected]}
[email protected]
Mailbox_password=xxxxx
The controller code looks like below,
$imap_resource = imap_open($mailbox, $username, $password);
$search_sender = '[email protected]';
$search = 'FROM "' . $search_sender . '" ON "06 April 2022"';
$emails = imap_search($imap_resource, $search);
This code is deployed to two servers(Staging and Production) which are hosted in digitalocean droplet.
This works in Staging and $emails returns
Array
(
[0] => 3652
[1] => 3659
)
but does not work on the production server. It gives an empty response.
Are there any specific mail settings to be checked or configured on the server-side to get this working? Or possibly any firewall causing the issue?
Note:- imap_open works, I am getting the IMAP resource id correctly, but imap_search only fails.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论