I'm using node.js for my desktop app. I need to send email from it. So I use the below code:
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");
This invokes the email client, but the email body text is truncated by around 200 characters.
I tried the below code also:
require("openurl").mailto(["john@example.com", "jane@example.com"],
{ subject: "Hello!", body: "This is\na generated email!\n" });
Reference link: https://github.com/rauschma/openurl
This code just adds the email id (first email) and nothing else (subject and email body doesn't get added).
openurl is not meant to send email, this is meant to ask the OS to open the url in the most adapted app. So http url would open in your default browser, and mailto will open in your mail app to compose the email.
To send an email from node.js, this question provides plenty of options: Sending emails in Node.js?