View Single Post
  #1066  
Old 07.02.2020, 16:55
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by leotzian View Post
I CAN sent emails via CLI, but I cannot make the script in Jdownloader to work, email IS sent but goes to spam it has no title, body and subject.
I had created those scripts based on the information provide in this link:
Code:
mkleine.de/blog/2016/01/07/synology-sendmail-per-shell-aktivieren/

English version:
Code:
// Send email notification (NAS)
// Trigger Required: A Download Stopped
// Important: Enable "Synchronous execcution" checkbox in top panel

if (link.isFinished()) {
    var sender = "sender@here.com";
    var receiver = "reciever@herere.com";
    var message = getPath(JD_HOME + "/download finished notification.txt");

    writeFile(message, "Link Finished: " + link.getName(), true);
    callSync("sendmail", "-F", sender, "-t", receiver, "<", message);
    deleteFile(message, false);
}

In this case the message body is first written to a temp file and then passed to the call. I guess it might also be possible to include the subject in it.
Reply With Quote