Created
June 25, 2018 11:36
-
-
Save tonis2/7639afe88a6b27ca4eca5223797e70b5 to your computer and use it in GitHub Desktop.
Send mail with node.js and ssmtp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const emails = "[email protected]" | |
const msg = `<p><span>msg:${req.body.msg}</span> <br /> <span>url:${req.body.url}</span> <br /> <span>line:${req.body.lineNo}</span> <br /> <span>column:${req.body.columnNo}</span> <br /> error:${req.body.error}</p>`; | |
exec.exec(`echo "From:[email protected]\r\nDate: $(date)\r\nSubject:website crash report\r\nMIME-Version: 1.0\r\nContent-Type: text/html; charset=utf-8\r\n\r\n ${msg}" | sudo ssmtp -vvv -C ssmpt2.conf -ap 55604881 -F " Pro error" ${emails}`, (err, stdout, stderr) => { | |
if (err) {return;} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment