简体   繁体   English

使用PHP imap_open在收件箱中打开其他文件夹

[英]open different folder in inbox using PHP imap_open

I am using this PHP Code to open a POP3 mailbox: 我正在使用以下PHP代码打开POP3邮箱:

$hostname = '{mail.domain.com/pop3:110/notls}INBOX';
$username = 'email@domain.com';
$password = '***';

$inbox = imap_open($hostname,$username,$password) or die('Cannot connect: ' . imap_last_error());

i am using the above code to open a POP3 mailbox 我正在使用上面的代码打开POP3邮箱

i tried using 我尝试使用

$hostname = '{mail.domain.com/pop3:110/notls}INBOX';

to open a folder inside the inbox but i got the error: 打开收件箱内的文件夹,但出现错误:

Warning: imap_open() [function.imap-open]: Couldn't open stream {mail.domain.com/pop3:110/notls}INBOX.Support in /home/integra/public_html/autocheck/support_emails.php on line 31

how can i open different under my Inbox folder? 如何在收件箱文件夹下打开其他文件夹?

According to the docs you need use this format: 根据文档,您需要使用以下格式:

"{" remote_system_name [":" port] [flags] "}" [mailbox_name]

So 所以
{mail.domain.com/pop3:110/notls}INBOX

should probably be 应该是
{mail.domain.com:110/pop3/notls}INBOX

Also make sure you can actually connect to the server on port 110, for example on a Linux/UNIX machine you can test this with: 还要确保您实际上可以通过端口110连接到服务器,例如,在Linux / UNIX计算机上,可以使用以下方法进行测试:

$ telnet example.com 110

If you see Escape character is '^]'. 如果您看到Escape character is '^]'. , you're connected. ,您已连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM