I use the Mail module on another project. It works great. Slick and simple.
However, on this new project, I can't seem to figure out why the email is not being sent. Well - the root cause anyway.
After preparing the email, the code executes the 'emailMessage.send();' method, and in the console, I see: "sh: sendmail: command not found".
Here is the test code segment:
var console = require('console');
var Mail = require('Mail').Mail;
var emailMessage = new Mail();
emailMessage.setFrom('sys...@MyDomain.com');
emailMessage.setTo('m...@MyDomain.com');
emailMessage.setSubject('Subject.');
emailMessage.setText('Body.');
emailMessage.send();
This is a 'cut and paste' from the working project. So, I doubt the issue is there. It has to be an environment issue.
On both projects, the silkjs executable is being run by the same user I log in as ('webdev'). When I log in as webdev, I can find sendmail from the command line with 'locate sendmail', but not with 'which sendmail'. That doesn't make sense. If it is a PATH issue, they should both fail.
Anyways, the test command "echo body | mail -vs subject
m...@mydomain.com;" works on both systems.
When I installed the mail packages, it was with:
apt-get install postfix heirloom-mailx -y;
What is the next step in debugging? I have almost zero experience with the silkjs console, and I get stuck there with getting 'undefined' all the time.
Any help is appreciated.
Thanks,
Eric