Question

I am developing a PHP website where it is possible to make wall posts / comments.

At this point, I already use PHP mail() to send a email to a person when something is posted on their wall.

Here is my question now: I would like to know how is it that Facebook does to be able to reply directly to email and make it appears as comment on the site, without need to login or anything - just a normal e-mail reply.

  • Is this possible to acomplish with PHP?
  • How is it possible to generate a dynamic reply-to header with the id and so, and then retrieve it automatically and post a comment with it...?

I have searched around Google but could not find to much about this...

Any help or starting point would be appreciated.

Thank you.

Was it helpful?

Solution

If you check the address from which the email was sent, it's a bunch of digits and letters, probably representing the post ID as well as the user ID encrypted to some form. They must then check for all emails on their SMTP server and add the replies according to received emails.

I think that's the basics of it, anyways. They do something similar for you to upload pictures by email.

OTHER TIPS

First of all, I do not use Facebook. I don't even have an account.

So, my guess would be that a background-running software / script check constantly for answers in their mailbox and submit the answers on the wall.

The way they could "remember" where to post the answer is probably using encoded data in the Reply-To Address.

shrug

I hope this help..

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top