只是给这个论坛上的人打个电话:在 Kony 论坛上的这个回复下回答了这个问题:http: //developer.kony.com/konyforum/viewtopic.php ?id=3900
function generateVCard(){
var email=frmDetails.lblEmail.text;
var off=frmDetails.lblOff.text;
var mob=frmDetails.lblMob.text;
var fullName = frmDetails.lblName.text
var lname= frmDetails.lbllname.text;
var fname=frmDetails.lblfname.text
var offName= frmDetails.lblLocOff.text;
var jbTitle = frmDetails.lblDetDesg.text
var conList = "BEGIN:VCARD\r\n";
conList += "VERSION:3.0\r\n";
conList += "N:"+lname+";"+fname+"\r\n";
conList += "FN:"+fullName+"\r\n";
conList += "ORG:"+offName+"\r\n";
conList += "TITLE:"+jbTitle+"\r\n";
conList += "TEL;TYPE=WORK,VOICE:"+off+"\r\n";
conList += "TEL;TYPE=HOME,VOICE:"+mob+"\r\n";
conList += "ADR;TYPE=WORK:"+offName+"\r\n";
conList += "EMAIL;TYPE=PREF,INTERNET:"+email+"\r\n";
conList += "END:VCARD\r\n";
kony.print("VCF : "+conList);
var encStr = Base64.encode(conList);
kony.print("Encoded string - : "+encStr);
var rawStr = kony.convertToRawBytes(encStr);
return rawStr;
}
function mailAttach(){
kony.print("Email id:");
var lname= frmDetails.lbllname.text;
var fname=frmDetails.lblfname.text
var fulName = fname +"_"+ lname+".vcf";
kony.print("FULLNAME:"+fname +"_"+ lname);
var to=[];
var cc=[];
var bcc = [];
var sub = "Get Connected with "+fname+" "+lname;
var msgbody = "";
var rawBytes = generateVCard();
kony.print(rawBytes);
tab= [ { mimetype : "text/x-vcard", attachment : rawBytes , filename : fulName }];
kony.print("tab>>>>");
kony.print(tab);
kony.phone.openEmail(to, cc, bcc, sub, msgbody,false, tab);
kony.print("after open email");
}