1 | var sendmail = require('../sendmail')({silent: true})
|
2 | sendmail({
|
3 | from: 'test@yourdomain.com',
|
4 | to: 'info@yourdomain.com',
|
5 | replyTo: 'jason@yourdomain.com',
|
6 | subject: 'MailComposer sendmail',
|
7 | html: 'Mail of test sendmail ',
|
8 | attachments: [
|
9 | {
|
10 | filename: 'text1.txt',
|
11 | content: 'hello world!'
|
12 | },
|
13 | {
|
14 | filename: 'text2.txt',
|
15 | content: new Buffer('hello world!', 'utf-8')
|
16 | },
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | {
|
25 | filename: 'text.bin',
|
26 | content: 'hello world!',
|
27 | contentType: 'text/plain'
|
28 | },
|
29 | {
|
30 | filename: 'license.txt',
|
31 | path: 'https://raw.github.com/guileen/node-sendmail/master/LICENSE'
|
32 | },
|
33 | {
|
34 | filename: 'text1.txt',
|
35 | content: 'aGVsbG8gd29ybGQh',
|
36 | encoding: 'base64'
|
37 | },
|
38 | {
|
39 | path: 'data:text/plain;base64,aGVsbG8gd29ybGQ='
|
40 | }
|
41 | ]
|
42 | }, function (err, reply) {
|
43 | console.log(err && err.stack)
|
44 | console.dir(reply)
|
45 | })
|
46 |
|