mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
JS: Add EmailClients lib
This commit is contained in:
@@ -0,0 +1 @@
|
||||
| tst.js:17:2:19:3 | transpo ... ');\\n\\t}) | tst.js:11:12:11:31 | 'sender@example.com' | tst.js:12:10:12:55 | 'receiv ... le.com' | tst.js:13:15:13:28 | 'Some subject' | tst.js:14:12:14:15 | 'Hi' | tst.js:15:12:15:22 | '<b>Hi</b>' |
|
||||
@@ -0,0 +1,4 @@
|
||||
import javascript
|
||||
|
||||
from EmailSender send
|
||||
select send, send.getFrom(), send.getTo(), send.getSubject(), send.getPlainTextBody(), send.getHtmlBody()
|
||||
20
javascript/ql/test/library-tests/EmailClients/tst.js
Normal file
20
javascript/ql/test/library-tests/EmailClients/tst.js
Normal file
@@ -0,0 +1,20 @@
|
||||
let nodemailer = require('nodemailer');
|
||||
let config = require('./account-config');
|
||||
|
||||
function sendMessage() {
|
||||
let transporter = nodemailer.createTransport({
|
||||
host: config.host,
|
||||
port: config.host,
|
||||
auth: config.auth
|
||||
});
|
||||
let mailOptions = {
|
||||
from: 'sender@example.com',
|
||||
to: 'receiver1@example.com, receiver2@example.com',
|
||||
subject: 'Some subject',
|
||||
text: 'Hi',
|
||||
html: '<b>Hi</b>'
|
||||
};
|
||||
transporter.sendMail(mailOptions, (error, info) => {
|
||||
console.log('Message sent');
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user