ShopMAster Posted March 6, 2007 Share Posted March 6, 2007 Hey guys, I'm fairly new to PHP, but getting better everyday through an application that I'm creating from scratch. So far so good. My question is how would I go about getting an email into a database. I've heard about parsing but honestly have no clue as to how to do it. If someone can point me to an article or something I can read that would be appreaciated. I have an email that comes to me every day in the same format but with different data and I want to store that email into my database to retrieve later. Is there a way it can automatically be done? I've heard they have software that does this but like I said, I do not even know where to begin. Thanks for your help. PHPFreaks is the best. Shopmaster Link to comment https://forums.phpfreaks.com/topic/41433-parsing-email-procedures-some-guidance/ Share on other sites More sharing options...
skali Posted March 6, 2007 Share Posted March 6, 2007 http://wiki.jumba.com.au/wiki/Pipe_an_email_to_a_script Once you have piped properly and your script is receiving the email. $email_file = fopen("php://stdin", "r"); this script as described in the tutorial will have the complete contents of the email and you can do whatever you want with it. Link to comment https://forums.phpfreaks.com/topic/41433-parsing-email-procedures-some-guidance/#findComment-200796 Share on other sites More sharing options...
ShopMAster Posted March 6, 2007 Author Share Posted March 6, 2007 When I tried to put the | php -q -n /home/USERNAME/public_html/SCRIPT.php into the forward email it didn't take. Is there some software that does this? Link to comment https://forums.phpfreaks.com/topic/41433-parsing-email-procedures-some-guidance/#findComment-201044 Share on other sites More sharing options...
skali Posted March 7, 2007 Share Posted March 7, 2007 If you are using sendmail the pipe can be put into /etc/aliases in the following form: [email protected]: "| php /path/to/yourscript_handling_mail.php" Link to comment https://forums.phpfreaks.com/topic/41433-parsing-email-procedures-some-guidance/#findComment-201435 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.