Node Webkit - 通过 Outlook 打开和发送电子邮件 [英] Node Webkit- opening and sending emails via outlook

查看:69
本文介绍了Node Webkit - 通过 Outlook 打开和发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Cordova 应用程序,我想使用 Node Webkit 在桌面上运行.

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

我需要用 Node Webkit equivelant 替换 cordova.plugins.email() 函数,但我很难找到我需要的信息.

I need to replace cordova.plugins.email() function with a Node Webkit equivelant but am struggling to find the info I need.

有人可以帮忙吗?

//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;
        }
      );
});

上面的代码基本上打开了一封新电子邮件并预填充了电子邮件.我找不到太多关于如何做到这一点的信息.我遇到过 nodemailer,但我认为这不是我需要的,因为我想在 Outlook 中打开和发送电子邮件并预填充,让用户添加电子邮件地址.

The above code basically opens up a new email and pre-populates the email. I cannot find much information out there on how to do this. I have come across nodemailer but I don't think this is what I need as I would want to open up and email in Outlook and prepopulate, leaving the user to add the email address.

非常感谢

推荐答案

哦,这太简单了,不知道为什么我试图把它复杂化!原来我需要使用 Nodewebkit GUI 库.

oh this is so simple, not sure why I tried to overcomplicate it! Turned out I sneeded 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');

这篇关于Node Webkit - 通过 Outlook 打开和发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆