如何使php脚本从服务器读取电子邮件? [英] how to make a php script that read an email from the server?
问题描述
有没有什么办法,当我用户发送电子邮件到admin@xx.com php脚本读取电子邮件的信息并自动重播给用户?
:有没有什么方法,当有人给我发电子邮件到admin@xx.xx一个脚本会被调用比每5秒使用cron工作更好
欢呼
如已经建议的那样,检查电子邮件箱(POP3或IMAP)是处理电子邮件的有效方法。但是,如果您正在寻找实时处理,则可以将邮件直接发送到php作为标准输入。
您基本上告诉邮件服务器将邮件传递到本地脚本。
您将不得不深入到CLI PHP中,并配置您的邮件服务器(需要与处理脚本在同一台服务器上)。所以这不是一个完全简单的过程。但这是可能的。我目前使用这种方法运行PHP电子邮件讨论列表。
我很久以前就配置好了,所以我不记得所有的细节;但这篇文章应该指向正确的方向。 / p>
is there any way that when i user send an email to admin@xx.com the php script reads the email's information and replay to the user automatically ?
EDIT :: is there any method that when someone send me an email to admin@xx.xx a script will be called that's better than using cron job every 5 seconds
Cheer
As already suggested, checking an e-mail box (POP3 or IMAP) is a valid way to process e-mail. However, if you're looking for realtime processing, it is indeed possible to have the mail delivered directly to php as standard input.
You basically tell the mail server to deliver the message to a local script.
You'll have to delve into CLI PHP, and configure your mail server (which will need to be on the same server as you processing script). So it's not an entirely simple process. But it is possible. I currently run a PHP powered e-mail discussion list using this method.
I configured my long ago, so I can't recall all the details; but this article should point you in the right direction.
这篇关于如何使php脚本从服务器读取电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!