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?");