0

I'm creating a a social networking application on the Facebook platform and I need some way of allowing my users to communicate with each other to find out more about each other. After doing some research on SO it seems sending private messages is a very popular topic, but so far the most promising option for us seems to be this - Send private messages to friends - which is a pop-out JS client which unfortunately only allows you to send posts to your friends.

I actually find this very odd seeing as it appears that I can click on ANYONE'S profile and go to "send message" and send them a message WITHOUT permission, but there are no options to send messages between users of your app even WITH their permission!

1) I have seen Facebook applications which provide contact between their users such - Yoke and other dating applications - how do they do it? Are they writing their own php messaging systems?

2) Is there anything stopping me from sending messages to a users account using their facebook email address? This will obviously allow people who aren't your friends to send emails to you.

Thanks for reading :D

Community
  • 1
  • 1
user1058210
  • 1,639
  • 7
  • 29
  • 49

2 Answers2

0

I will go ahead and answer number 2 first. You do need users permission before sending them a message. It is part of the User and Friends permission as described here https://developers.facebook.com/docs/authentication/permissions/#user_friends_perms

Provides access to the user's primary email address in the email property. Do not spam users. Your use of email must comply both with Facebook policies and with the CAN-SPAM Act.

This link will show you how to make that call. https://developers.facebook.com/docs/reference/api/message/

About Scenario 1: I think if you have the permissions then your app users can surely email each other and you can use a simple email function for that.

pal4life
  • 3,210
  • 5
  • 36
  • 57
  • Thanks for answering another question pal4life! What I mean is that outside of my application, if I want to send a message to a random person I don't need any permission. I just click on the message button and it lets me. The call you mentioned appears to only relate to READING messages and not SENDING them unfortunately. I am looking into "send dialogs" and they seem promising - a prompt comes up where the user can send a message, which can be to a random person if they know the facebook email. Unfortunately there is no way of populating the field with an email you have on record. – user1058210 Aug 06 '12 at 20:33
0

You can send a Facebook message to any Facebook user just by simply sending an email to username@facebook.com and it will automatically reach their Facebook Messages as a Facebook message. No additional permission is required for this operation.

<?php
    $to = "username@facebook.com";
    $subject = "Test mail";
    $message = "Hello! This is a simple email message.";
    $from = "me@facebook.com";
    $headers = "From:" . $from;
    mail($to,$subject,$message,$headers);
    echo "Mail Sent.";
?>

PHP mail function - http://php.net/manual/en/function.mail.php

Mysophobe
  • 622
  • 2
  • 10
  • 33