Link to home
Start Free TrialLog in
Avatar of Ron1959

asked on

How do I forward email to a PHP script for processing on a Windows server?

I need to forward individual emails to a PHP script running on a Windows server.

I have scripts to parse the email so a database can be populated, but I have not been able to figure out how to automate the process of getting the email (eml) file to the script.

Any help would be greatly appreciated.
Avatar of StingRaY
Flag of Thailand image

I suggest you to create a separate email account for this purpose and create a php script to access the new account inbox instead of forward an email to the script.
Avatar of zedgama3

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ron1959


I had tried imap_open previously but could not get it to work.  Your link: helped a lot.

I used: $mbox = imap_open ("{}INBOX", "user_id", "password");

For my application, the user can initiate the mail check, so I don't need a cron job.

Now that I can open the INBOX I need to figure out how to either save individual emails to a directory or pass them to a php script.

I'll look for that, but guidance would be appreciated!