hybmg57 Posted January 29, 2011 Share Posted January 29, 2011 Hi All, Is there a way we can write a PHP script to automatically read receive emails, extract csv file attachment from there and insert into MySQL database then run this in Cron Jobs to automate the process? Quote Link to comment Share on other sites More sharing options...
nankoweap Posted January 29, 2011 Share Posted January 29, 2011 if you're on a unix/linux box, it's simple to parse the emails and do whatever you want with them as they arrive. look into .forward files and how to pipe each email to a process. iirc, the .forward would look something like: | php <your email parsing php file> i've used this method before and it works quite well. google .forward files for the proper syntax. there's a lot you can do with them. Quote Link to comment Share on other sites More sharing options...
hybmg57 Posted January 29, 2011 Author Share Posted January 29, 2011 How do you parse the emails in cpanel? I'm sorry I'm a beginner and cannot exactly understand what you mean. Thank you for you help... Kind regards, Jae Quote Link to comment Share on other sites More sharing options...
nankoweap Posted January 29, 2011 Share Posted January 29, 2011 not being familiar with cpanel, i don't know. however, if there's not a way to direct received email from within cpanel, then contact your web hosting provider and ask them if something like this is supported and, if so, how to do it. Quote Link to comment Share on other sites More sharing options...
hybmg57 Posted January 30, 2011 Author Share Posted January 30, 2011 I have asked the hosting provider and they said it is not possible with cPanel. Is there a tutorial that you could share with us? Thank you for your help. Quote Link to comment Share on other sites More sharing options...
nankoweap Posted January 30, 2011 Share Posted January 30, 2011 no tutorials, but i just googled and found this: http://www.ispexperts.com.np/?p=664 Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted January 30, 2011 Share Posted January 30, 2011 This is very possible with cPanel. I read email messages in a number of my sites. You need a PHP script that will read the incoming email. Here's one tutorial. Another useful script is mime_parser.php which can get the attachment. Then you need to set up a forward email in cPanel (see attachement) Ken [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.