-
Notifications
You must be signed in to change notification settings - Fork 205
Expand file tree
/
Copy pathsend-email.js
More file actions
44 lines (37 loc) · 865 Bytes
/
Copy pathsend-email.js
File metadata and controls
44 lines (37 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* Copyright (c) Forward Email LLC
* SPDX-License-Identifier: BUSL-1.1
*/
const process = require('node:process');
const nodemailer = require('nodemailer');
const logger = require('#helpers/logger');
(async () => {
const transporter = nodemailer.createTransport({
logger,
debug: true,
host: 'localhost',
port: 2587,
secure: false,
tls: {
rejectUnauthorized: false
},
auth: {
user: process.env.ALIAS_USER,
pass: process.env.ALIAS_PASS
}
});
const info = await transporter.sendMail({
envelope: {
from: process.env.ALIAS_USER,
to: [process.env.ALIAS_USER]
},
raw: `
From: ${process.env.ALIAS_USER}
To: ${process.env.ALIAS_USER}
Subject: test
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Test`.trim()
});
console.log('info', info);
})();