View Single Post
  #1064  
Old 07.02.2020, 13:28
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 853
Default

Quote:
Originally Posted by leotzian View Post
sendmail -F "Synology Station" -f "sender@here.com" -t reciever@herere.com << EOF
Subject: Synology Mail Test
All working fine.
EOF


Is it easy for you to convert the above jdownloader script to this format I had not know how...
I man not familiar with linux commands. Use following method to run terminal commands from script:

Method:
Code:
var myString = callSync(myString[]);/*Call a local Process. Blocks Until the process returns*/
/* Example: */var pingResultString = callSync("ping","jdownloader.org");

I am guessing something like this may work:
Code:
callSync("sendmail", "-F", "\"Synology Station\"", "-f", "\"sender@here.com\"", "-t", "reciever@herere.com", "<<", "EOF", "\r\nSubject: Synology Mail Test\r\nAll working fine.\r\n", "EOF");

Also, I am not sure how linux handles "\r\n".
Reply With Quote