我将 node.js 用于我的桌面应用程序。我需要从它发送电子邮件。所以我使用下面的代码:
require("openurl").open("mailto:"+emailAddress+"?" +
"subject=TEST subject&" +
"body=Hello! How are you?\nHello! How are you?\nHello! How are you?\nHello! " +
"How are you?\nHello! How are you?\nHello! How are you?\nHello! How are you?\n" +
"Hello! How are you?\nHello! How are you?\nHello! How are you?\n");
这会调用电子邮件客户端,但电子邮件正文会被截断大约 200 个字符。
我也尝试了以下代码:
require("openurl").mailto(["john@example.com", "jane@example.com"],
{ subject: "Hello!", body: "This is\na generated email!\n" });
参考链接:https ://github.com/rauschma/openurl
此代码仅添加电子邮件 ID(第一封电子邮件),没有其他任何内容(未添加主题和电子邮件正文)。