Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
19
rated 0 times [  22] [ 3]  / answers: 1 / hits: 19844  / 11 Years ago, fri, april 19, 2013, 12:00:00

I have already included this in my page html:



<div id=fb-root></div>
<script type=text/javascript language=javascript>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = //connect.facebook.net/en_US/all.js#xfbml=1;
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>


And that I have facebook-like box in my page already, however I need to do now a way to send messages to email using the Facebook Javascript API. Is this configuration enough to call a send message?



I have a custom HTML form in which when I click send I like it to send a message on my Facebook page's behalf. I have my page up in Facebook.




  • I need to send message without any server side component (pure Javascript)

  • I have a existing Facebook page (which I will use to send messages with)

  • I have a custom form in which will be used to type in message.

  • The message will be sent to some specific email address

  • I can send to any email with Facebook so I assume this will work


More From » facebook

 Answers
219

I will answer your questions separately:




  • I need to send message without any server side component (pure
    Javascript)



If it can be a simple message to a facebook user, you have to use the FB.ui send dialog: https://developers.facebook.com/docs/reference/dialogs/send/
That´s pretty much the only way for you, you can just try putting in an email address in the popup. According to the documentation, it should work.




  • I have a custom form in which will be used to type in message.



That´s where even the send dialog will not work anymore. You cannot prefill the message parameter, what you want would only be possible with the PHP SDK of Facebook. But then again: Why would you program the textfield on your own, if Facebook already offers everything in that dialog?



Without that dialog, there is no way to just send a message in the background without a server side language like PHP.


[#78789] Thursday, April 18, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kinsley

Total Points: 352
Total Questions: 84
Total Answers: 94

Location: Denmark
Member since Tue, Jul 19, 2022
2 Years ago
;