Prabhu
Prabhu

Reputation: 13335

Is it possible to determine the @Facebook.com email address of a user?

Is it possible to figure out reliably what the Facebook email of any Facebook user would be? I know earlier this was not possible because not all users had a username. But I believe that has changed since...

I'm trying to figure out a way to let a user send a direct message to their friend through my app. The Request feature is pretty messed up now as you cannot send a custom message, which means most friends are probably going to ignore the request.

The type of messages that I am trying to let my users send to their friends would not be considered spam by Facebook, as these are messages sent directly from the user to their friend, except it is done through the app. But it's pointless if the message just says "Joe wants you to try this app..." The usefulness of an app on the Facebook platform is becoming questionable now.

Upvotes: 1

Views: 163

Answers (3)

Kishor
Kishor

Reputation: 1513

If what you are looking for is to give them a new message notification, it is not going to work. Because, if you send an email to the facebook email, it will land in the Others folder in the message box, which is like a spam box.Try mailing your own @facebook id and see what happens.

And Facebook doesnt give any documentation of how to get users @facebook email, most probably because they dont want developers to use it.

Why dont you mail them directly? You can easily get their email by adding email to the scope, and you can catch the email easily too.

$data = file_get_contents("https://graph.facebook.com/me?access_token=xxxxxx");

$data = json_decode($data,true);

$email = $data['email'];

Is that a viable option in your case?

Upvotes: 0

C3roe
C3roe

Reputation: 96407

Is it possible to figure out reliably what the Facebook email of any Facebook user would be? I know earlier this was not possible because not all users had a username. But I believe that has changed since...

Yes, now every user should have a username set – if not by themselves, than FB will have chosen one for them.

Besides that, I think writing to userid@facebook also works.

But I agree with combinatorial’s answer – Facebook explicitly says that this should not be used for app-to-user communication. To judge if your case is OK is up to you – otherwise you might consider using the send dialog instead, that’s more of the “designated” way to have users communicate “through” your app.

Upvotes: 0

combinatorial
combinatorial

Reputation: 9561

I think that facebook terms and conditions disallow this...

Facebook messaging (i.e., email sent to an @facebook.com address) is designed for communication between users, and not a channel for applications to communicate directly with users."

Despite your caveat at the end of your post I believe that facebook would consider this a message from your app to the user.

In terms of your question, then the user data returned includes 'username' which is the information you need to create the email address.

Upvotes: 3

Related Questions