Link to home
Start Free TrialLog in
Avatar of Ron1959
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
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.
ASKER CERTIFIED SOLUTION
Avatar of zedgama3
zedgama3

Link to home
membership
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
Ron1959

ASKER

I had tried imap_open previously but could not get it to work.  Your link: http://us2.php.net/manual/en/function.imap-savebody.php helped a lot.

I used: $mbox = imap_open ("{mail.domain.com:110/pop3}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!

Thanks!