2

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.

PGZ
  • 485
  • 1
  • 5
  • 11

2 Answers2

1

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.

Alex Turpin
  • 46,743
  • 23
  • 113
  • 145
1

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

Cybrix
  • 3,248
  • 5
  • 42
  • 61
  • 1
    *Rant Warning* "Use your downvotes whenever you encounter an egregiously sloppy, no-effort-expended post, or an answer that is clearly and perhaps dangerously incorrect.". Okay, this post wasn't the most specific, but not incorrect, not no-effort, and not dangerously incorrect. The answer gave reasonable information that is, in fact, a possibility. @Xeon06's answer was better, but Cybrix was fine with his answer. What is wrong with Stackoverflow? If I were the OP, I would appreciate all help. – John Davis Feb 13 '13 at 05:10
  • And this comment came over two years later... oh well. I'm not in a good mood anyways.... – John Davis Feb 13 '13 at 05:12
  • I admit my answer could have been better but maybe the downvote was because I *wasn't* a Facebook user. Who knows... – Cybrix Feb 13 '13 at 18:03
  • Yeah it was still a helpful enough answer to not be down-voted. This has just become such a harsh community. If you look at other Stack Exchange sites, they are much friendlier than Stack Overflow. – John Davis Feb 13 '13 at 20:48