"how do i receive email and process it in a web application" Code Answer

4

I recently worked on a project that required parsing of email from gmail and updating database with certain values based on the contents of the email. I used the ezcMail (now) Zeta Components library to connect to the mail server and parse the emails.

The strategy I adopted was to filter all interesting incoming mail with a label "unprocessed". Run the PHP script via a crontab every 15 minutes. The script would connect to the mail server and open the IMAP unprocessed folder and parse each email. After inserting the interesting values into the database, the script moves the files to another IMAP folder "Proccessed".

I also found IMAP to be better than POP for this sort of processing.

By Óscar López on September 18 2022

Answers related to “how do i receive email and process it in a web application”

Only authorized users can answer the search term. Please sign in first, or register a free account.