|I've tried using parseMail.php with a script I have, but I can't seem to populate any of the variables.|
I know that the data from the STDIN is available, because other, simpler scripts can see it, but when I use this script I can't figure out how to grab the 'From', 'to', 'subject' etc. into my script so that I can write the values to the MySQL database and or create and send a new email using them.
Basically what I'm trying to do is pipe email into a script, then query MySQL to see who to send it to based on the 'From' email address. I'm doing this to basically offer anonymous email addresses to my website users - basically the same as Craigslist.
1) Email is sent to firstname.lastname@example.org
2) Script parses the email address
// Example: $userid = explode("-",$fromaddress);
3) Script queries MySQL for email address associated with '$userid'
4) Script sends the email to the user's email address with a header and footer.
The problem is that I can't seem to grab any of the information from the original email in order to extract what I need to.
Any help would be very much appreciated. I'm already past my deadline.
Please help. I know this is a newbie question, but I'm stumped.