Jump to content

Advanced: Updating database when server receives an email?


mikefrederick

Recommended Posts

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.

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.