Phonegap : capture Image, Video and Send as Attachment in Email

我怕爱的太早我们不能终老 提交于 2019-11-29 11:39:54

if you are using Cordova 3.0.0 ... you can install this plugin(https://github.com/steve-jansen/cordova-ios-emailcomposer) locally using the following command

cordova plugin add emailcomposer # using the http://plugins.cordova.io registry

 add the path of your image in the body as below code

var emailComposer = cordova.require('emailcomposer.EmailComposer');
emailComposer.show({ 
   to: toemail,
   subject: emailsubject,
   body: '<p> '+body+'</p><img alt="Embedded Image" height="200" width="200" src="'+path+'" />',
   isHtml: true,
});

image path is taken from this function

 function sendEmail(imageData) {
   var largeImage = document.getElementById('largeImage');
       largeImage.style.display = 'block';
       largeImage.src = "data:image/jpeg;base64," + imageData;
  path = "data:image/jpeg;base64," + imageData; // this variable I used in body of email
  var cc = Ext.ComponentQuery.query('camerashare');
  cc[0].items.getByKey('ttbar').show();

}

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!