Node Webkit - opening and sending emails through Outlook

I have a cordova application that I want to run on desktops using Node Webkit.

I need to replace the cordova.plugins.email () function with Node Webkit equivelant, but I'm struggling to find the information I need.

Can anyone help?

//email composer $('#stage').on('click', '#email', function(event){ var pdfatt = (this.getAttribute('data-pdfemail')); var profforename = window.localStorage.getItem('profForename'); var profsurname = window.localStorage.getItem('profSurname'); var profemail = window.localStorage.getItem('profEmail'); cordova.plugins.email.isAvailable( function (isAvailable) { cordova.plugins.email.open({ body:'<p><img src="wp-content/uploads/2016/06/Email_Header.jpg"/></p><br><br>From:<p>'+profforename+' '+profsurname+'</p><p>Tel:'+proftel+'</p><p>Mob: '+profmob+'</p><p>Email: '+profemail+'</p><br><br><a href="'+pdfatt+'"><img height="30px" src='+baseurl+'"/wp-content/uploads/2016/06/download-pdf.jpg"/><br>Click To Download the PDF</a><br><br><br><p><img src="/wp-content/uploads/2016/06/Email_Footer.jpg"/></p>', subject: 'subject', isHtml: true }); //alert('Service is not available') unless isAvailable; } ); }); 

The above code basically opens a new email and pre-populates the email. I can not find much information on how to do this. I came across nodemailer, but I don’t think that this is what I need, since I would like to open and send email in Outlook and pre-populate, leaving the user to add an email address.

Many thanks

+6
source share
1 answer

Oh, it's that simple, I don’t know why I tried to compromise him! It turned out I had to use the Nodewebkit GUI library.

 // Load native Nodewebkit UI library. var gui = require('nw.gui'); gui.Shell.openExternal('mailto: test@example.com ?subject=test&body=hello'); 
+4
source

All Articles