Forwarding emails with a PHP script

后端 未结 5 551
醉话见心
醉话见心 2021-01-05 01:58

We have a cron\'ed PHP script that checks an inbox every ten minutes. The purpose of this script is to handle \"STOP to quit\" functionality for our SMS notification service

5条回答
  •  自闭症患者
    2021-01-05 02:37

    This isn't really an answer, but a suggestion for an alternate method. I think it would be much simpler and less prone to error (i.e., no delivery issues) if you simply moved the messages around to different folders within the existing account. I.e., the cron runs and processes all emails in INBOX. If if finds STOP, it does the required work and then (via IMAP functions) simply moves the email to a subfolder named "Processed" or similar. Otherwise, it moves the email to a subfolder named "Check These" or similar. Then you don't need to worry about forwarding, or further deliveries, or a second account, and everyone can monitor the processed, unprocessed, and pending mails directly.

提交回复
热议问题