Jump to content

Advanced: Updating database when server receives an email?


mikefrederick

Recommended Posts

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

Link to comment
Share on other sites

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 messageboard@mysite.com)

-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

Link to comment
Share on other sites

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: messageboard@mysite.com 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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.