jil widget主要功能

发送邮件:
function ActiveSendEmailMessage(eSite,eBody,eSubject,eAddress){
var msg = Widget.Messaging.createMessage(Widget.Messaging.MessageTypes.EmailMessage);
msg.addAddress("destination",eSite);
msg.body = eBody;
msg.subject = eSubject;
Widget.Messaging.sendMessage(msg);
}
--------------------
接收短信并通过邮件转发
01.function set()  
02.{  
03. Widget.Messaging.onMessageArrived =function messgeCallBack(msg)  
04. {  
05.  var forwardStr = "";  
06.  if(msg.messageType == undefined || msg.messageType == null)  
07.  {  
08.   forwardStr += msg.body;  
09.  }  
10.  else 
11.   return;  
12.  ActiveSendEmailMessage(forwardStr);  
13. };  
14.}  
15. 
16.function ActiveSendEmailMessage(forwardStr)  
17.{  
18.   var eSite = document.getElementById("EmailSite").value;  
19.   var msg =                Widget.Messaging.createMessage(Widget.Messaging.MessageTypes.EmailMessage);  
20.   msg.addAddress("destination", eSite);  
21.   msg.body = forwardStr;  
22.   var subj = forwardStr;  
23.   if(forwardStr.length>10)  
24.   {  
25.    subj = forwardStr.substring(0,10)+"...";  
26.   }  
27.   msg.subject = subj;  
28.   Widget.Messaging.sendMessage(msg);  
29.} 
==========================================================

你可能感兴趣的:(widget)