开发者

reply to a comment via email and directly post it on the website commenting system

I have developed a website using PHP and MYSQL. The website has a commenting system through which registered users of the website can post comments on the feedback posted by different users.

When a comment is posted for a feedback an email is sent to the user who posted that feedback notifying him of new comments on his feedback.

Now what I want is that a feedback owner should be able to post a new comment in response to that comment by simply replying to the email 开发者_Go百科that has been sent by the website.

I hope I was able to explain my query properly. If it needs any improvement in explanation, I would be glad to know and make changes accordingly.


E-mail is an entirely different protocol than the web. First of all, you would be needing a program that would poll the inbox per account (notice that you would be needing a mail daemon too), and have some fuzzy logic that scans inside the message and puts it inside the comment that belongs it to. You can do this all manual, but I would recommend you to use a framework. For PHP, I would say Zend. I've added a link with some material.

http://framework.zend.com/manual/en/zend.mail.read.html

Off-the-record, I would go for RoR when it comes to this kind of interaction.


I do not know how you are sending emails currently, but you can easily Capture the Mails (sent, received, drafts etc.) of any standard Mail Server.

For e.g. you may use your GMAIL Account for sending Emails and Receiving Emails. So, in your PHP Website, you have to run a Cron Job (may be every 1 hour) which checks for the newly received mails in the GMAIL Account, scan through the Email Body or Subject to identify if the Mail is Reply to a Comment or not. If it is so, you may add it to your MySQL Database as a Reply to a Comment.

In order to send and receive mails from external Mail Servers like GMAIL, etc. you will be requiring IMAP or POP3 protocols. IMAP is already present in the default PHP Library set. This library provides a set of functions to send, retrieve and read mails from various Mail Boxes of your Mail Server Account.

For more details, you may visit:
http://gauravsworld.wordpress.com/2010/04/03/create-your-own-mail-client-like-ms-outlook/
Here, I have discussed on how to use IMAP in PHP for GMAIL

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜