How to send email to friends from my application

5 views
Skip to first unread message

ARUP

unread,
Dec 15, 2008, 6:29:32 AM12/15/08
to Orkut Developer Forum
Hi
I saw photoBuzz application(http://www.orkut.co.in/
Main#Application.aspx?uid=16491624182347011688&appId=844154928344) its
can send email to friends at the time of sending add request(Invite)
How can i implement in my application please help me.
Just i want to send email to my friends from my application.....

Vijaya

unread,
Dec 17, 2008, 1:18:20 AM12/17/08
to Orkut Developer Forum
You can achieve this my using the opensocial.requestSendMessage
function.
(http://code.google.com/apis/opensocial/docs/0.8/reference/
#opensocial.requestSendMessage)

Here's a sample snippet that you can use in the OpenSocial Developer
App
(http://osda.appspot.com/)

function sendEmail(title, body) {
var params = [];
params[opensocial.Message.Field.TITLE] = title;
params[opensocial.Message.Field.TYPE] =
opensocial.Message.Type.EMAIL;

var message = opensocial.newMessage(body, params);
var recipient = "VIEWER";
opensocial.requestSendMessage(recipient, message, callback);
};

function callback(data) {
if (data.hadError()) {
alert("There was a problem:" + data.getErrorCode());
} else {
output("Ok");
}
};

sendEmail("This is a test email", "How are you doing?");
Reply all
Reply to author
Forward
0 new messages