开发者

Triggering A Script When New Mail Arrives

开发者 https://www.devze.com 2023-04-03 02:21 出处:网络
I want to run a php script (for example mail.php) when anyone send a mail to go@domain.com . And then i will get sender, mail body and other informations, and i will use them on mail.php*.

I want to run a php script (for example mail.php) when anyone send a mail to go@domain.com . And then i will get sender, mail body and other informations, and i will use them on mail.php*.

I read a few articles about getting mails via PHP's IMAP functions. I can write a script which checks mail box every second (via cronjobs) and send unread mail's datas to mail.php .But i don'T want to do it via cronjobs.

Can i trigger mail.php script when someone send an email to go@domain.com, automatically ?

(recently i have a reseller acco开发者_如何学Pythonunt on a linux server (it's allowing IMAP). But i can bought a server (dedicated, vps, cloud etc.) if I really need it.)


Assuming it's a unix-based host, you can have a .forward file in that account's home directory pipe the email directly to a script. This script would read the email via its STDIN and then go from there.

Some examples shown here: http://www.activecampaign.com/support/tt/kb/article/help-desk/version-25x-26x/setting-up-supporttrio/setting-up-your-server-to-forward-email-to-the-pipe-script

0

精彩评论

暂无评论...
验证码 换一张
取 消