I'm trying to send an email through a userscript using smtpjs because it seems the easiest approach. However it seems more difficult than just sending it by javascript that is embedded in a HTML page. Using this userscript (based on the smtpjs website) I get no error in the console and no email is sent, is this a framework issue or am I missing something here? (if you suggest an easier way to send emails within a userscript don't hesitate to share)
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match *
// @grant none
// @require http://smtpjs.com/smtp.js
// ==/UserScript==
if (confirm("send mail?")) {
Email.send("FROM@gmail.com",
"TO@gmail.com",
"This is a subject",
"this is the body",
"smtp.gmail.com",
"USER",
"PW");
}
(I tried gmailAPI (pure JS version doesn't support sending emails?) and emailjs framework without success in userscripts)