Visitors can contact staff by means of contact form (visitor needs to submit email as well). This will be stored in DB. Now considering that staff responds to this message, the reply from the staff would be sent to the visitors email directly. Say if the user wants to follow up on the message sent by the staff, I would like the visitor to just hit the reply button in his email service & send me his questions on the same topic, but just retain the ID in the Subject line. So when the visitor send this email, I would like to receive the email & at the same time, try to search in my DB if the ID that is present in the email subject, actually exists in the system. If yes, that would be sent back to the same staff member who handled the response previously or it would be assigned to a new staff member.
That being said, I was thinking of how to do this. The part where I am really held up is when the staff receives the actual email from the visitors email, how can I check the DB? Say I am/staff is receiving emails at mydomain@hotmail.com. When visitor sends reply email, then it would be sent to mydomain@hotmail.com. How can I check to see if the ID in the subject line of the email that I received at mydomain@hotmail.com, actually exists in my DB in my website开发者_Python百科? This is where I am really stuck.
Looking forward for your replies. Thank you.
There are several approaches that you can use for automatically processing email. Which one you choose is going to depend upon your specific needs:
Configure your MTA (mail server) to run a program when it receives mail at a given address (eg: support@mydomain.com). The mail message itself will be passed to the program to handle. This works if you have your own mail server, and is the most responsive solution, but can be quite complex to configure and will usually require restarting the mail server to change.
Write a program that periodically scans a mailbox (either with POP or IMAP) and then processes each new message. This works better for situations where you don't control your own mail server (eg: you're using Gmail or Yahoo mail) and is more flexible to configure.
Write an extension for your MUA (mail client eg MS Outlook, Thunderbird, etc.) This requires that everyone who could receive a message be running the same client software, and it depends upon the APIs that your client provides for extensions. This won't work with web-only interfaces, but will allow you to process a message interactively and to interact with the user.
I tend to favor the first approach, though I have used the second approach as well.
Have a look at this zend library, it is nice and easy to incoporate into your site and means you dont have to try and write some hard code to read a message box etc
Hope it helps
Luke
精彩评论