Hey,
Is there a way that Im able to send an email to a certain email address then get a PHP script to connect to it a extract the separate data and insert it into a database?
+REP
Lew.

I believe it's possible, have a look here http://us2.php.net/manual/en/ref.imap.php to see the IMAP functions and then it's simply a case of storing it into the database.
So,
This would be a case of using imap_open() to open the imap stream, then read the body with imap_body()
Then get the script to seperate different things within the body to insert them into the database?
Example:
Email to: [email protected]
Body:
Engineer : #Lewis#
Customer Reference : #CTI34d3r5f#
Quote Reference : #QU4tgfS2#
Job Category : #1#
Job Type : #2#
Job Description : #RANDOM JOB!#
Equipment : #Additional Equip#
Then get PHP to separate he values between the #'s?
Sounds easy enough, Ill have a look into it, if anyone could suggest a way to do it, would be appreciated
Lew.
Check this out:
http://www.phpclasses.org/package/33...-database.html
I've never used this class but it seems to do what you want. You can modify it enough to make it work I believe.
Remember when you're exploding / separating your data in the body, to always clean it... don't want someone to commit SQL injection through your e-mail form![]()
Indeed, although Ill be using it at work an no1 has a clue about opening a php tag let alone a sql injectionCheck this out:
http://www.phpclasses.org/package/33...-database.html
I've never used this class but it seems to do what you want. You can modify it enough to make it work I believe.
Remember when you're exploding / separating your data in the body, to always clean it... don't want someone to commit SQL injection through your e-mail form
Lew.
Want to hide these adverts? Register an account for free!