mikefrederick Posted November 22, 2008 Share Posted November 22, 2008 Hopefully someone can help me here. I am wondering how to go about updating some tables in my databases when my server receives an email. For example, if I wanted to submit the body of the email into a database, how would I go about doing this? Directions, a link to a guide, or any help is appreciated. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/133803-advanced-updating-database-when-server-receives-an-email/ Share on other sites More sharing options...
corbin Posted November 22, 2008 Share Posted November 22, 2008 Chances are, your email server does not have a feature to do what your wanting to do its self or contact a script, therefore, you will have to make a script periodically check for new email. The basic idea will be: run a script every x seconds/minutes/days/whatever Have the script check for new email If there is new email, process it Quote Link to comment https://forums.phpfreaks.com/topic/133803-advanced-updating-database-when-server-receives-an-email/#findComment-696393 Share on other sites More sharing options...
mikefrederick Posted November 22, 2008 Author Share Posted November 22, 2008 I don't even know how I would setup a cron job to check for new emails. And I feel like there has to be another way. Basically, I have a message board on a website. When someone is sent a message, it is forwarded to their email address. I want people to be able to respond to emails directly from their email address. In other words: -they send a reply email (to something like [email protected]) -the contents of that email are stored in the database so that the message board is updated -the original message sender's email address is grabbed from the database and the email is forwarded to that email address Quote Link to comment https://forums.phpfreaks.com/topic/133803-advanced-updating-database-when-server-receives-an-email/#findComment-696405 Share on other sites More sharing options...
corbin Posted November 22, 2008 Share Posted November 22, 2008 There might be another way, but chances are, it won't be easier. Quote Link to comment https://forums.phpfreaks.com/topic/133803-advanced-updating-database-when-server-receives-an-email/#findComment-696412 Share on other sites More sharing options...
mikefrederick Posted November 24, 2008 Author Share Posted November 24, 2008 Yeah I know, but is it even possible to check for new emails via cron jobs? Quote Link to comment https://forums.phpfreaks.com/topic/133803-advanced-updating-database-when-server-receives-an-email/#findComment-697540 Share on other sites More sharing options...
n3ightjay Posted November 24, 2008 Share Posted November 24, 2008 You can use a cron job to query an email server ... but a simplier approach would be just to set up a forwarder if you have that ability ... ie set up a forwarder to receive from: [email protected] and forwards it to a php file to handle it ... This information is coming from a magazine article from PHP Architect in regards to dealing with sms and php but the concept is the same.. so for more information perhaps a google for ' php sms ' would provide you with more information Quote Link to comment https://forums.phpfreaks.com/topic/133803-advanced-updating-database-when-server-receives-an-email/#findComment-697575 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.