ios - Send an email from a flex app on both android and Iphone -


using flash builder have developed app both android , iphone. able open default email client on phone , send email attachment. have seen many examples using "mailto:" not supported attachment. have googled extensively , have found nothing current in last 3 years.

i make pdf file wish attach , can move temp directory if needed satisfy access issue. use default mailer other programs use if not doable please tell me how directly send email app.

just reference expand action script 3.0 information base. unable find way asking above. here method used send email attachment. https://code.google.com/p/airxmail/
http://flex.coltware.com/as3-flex-air/airxmail/

import com.coltware.airxmail.inetaddress; import com.coltware.airxmail.mailsender.smtpsender; import com.coltware.airxmail.mimemessage; import com.coltware.airxmail.recipienttype;  private function send_plain_email():void{ //  how send plain text email var sender:smtpsender = new smtpsender(); sender.setparameter(smtpsender.host,"your.smtp.hostname"); sender.setparameter(smtpsender.port,25);  // default port 25 // if use smtp-auth sender.setparameter(smtpsender.auth,true); sender.setparameter(smtpsender.username,"username"); sender.setparameter(smtpsender.password,"password");  // create email message var message:mimemessage = new mimemessage();  //  set email address , reciepients var from:inetaddress = new inetaddress("from-email-address@xxxx.yyyy","from label"); message.setfrom(from);  var torecpt:inetaddress = new inetaddress("to-email-address@xxxx.yyyy","to label"); message.addrcpt(recipienttype.to,torecpt);  var ccrecpt:inetaddress = new inetaddress("cc-email-address@xxxx.yyyy","cc label"); message.addrcpt(recipienttype.cc,ccrecpt);  //   message.setsubject("hello world"); // //  plain text part // var textpart:mimetextpart = new mimetextpart(); message.setsubject("reciept #" + job.jobs.jobid); textpart.contenttype.setparameter("charset","utf-8"); textpart.transferencoding = "8bit"; textpart.settext("please see attached pdf \n need pdf viewer open \n download latest version of adobe acrobat reader, please follow link: http://www.adobe.com/products/acrobat/readstep.html"); message.addchildpart(textpart);  // //  attachment part  //     var filepart:mimeimagepart = new mimeimagepart();     filepart.contenttype.setmaintype("application");     filepart.contenttype.setsubtype("pdf");            filepart.setattachementfile(file.desktopdirectory.resolvepath(sfile),"workorder.pdf");             message.addchildpart(filepart);              sender.send(message);             sender.close(); } 

Comments