Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 486 lines (360 sloc) 18.193 kb
ca1f7d8 v0.1
andris9 authored
1 Nodemailer
2 ==========
3
3c3cca5 updated readme
Andris Reinman authored
4 **Nodemailer** is an easy to use module to send e-mails with Node.JS (using
21c545d @andris9 Update README.md
authored
5 SMTP or sendmail or Amazon SES) and is unicode friendly - You can use any characters you like ✔
3c3cca5 updated readme
Andris Reinman authored
6
06eb6cb some minor housekeeping
Andris Reinman authored
7 Nodemailer is Windows friendly, you can install it with *npm* on Windows just like any other module, there are no compiled dependencies. Use it from Azure or from your Windows box hassle free.
8
cc5b5ae updated readme
Andris Reinman authored
9 Version v0.3 of Nodemailer is built from scratch and might break some existing scripts, so beware while upgrading. Nodemailer should be backwards compatible - if your script worked before, then it should work now, even if Nodemailer documentation differs from your code (method names, properties etc.).
93f2d1f Updated docs etc
Andris Reinman authored
10
3c3cca5 updated readme
Andris Reinman authored
11 Use [DocumentUp](http://documentup.com/andris9/nodemailer/) to read this README
12 in a more structured way (with TOC).
13
14 [![Build Status](https://secure.travis-ci.org/andris9/Nodemailer.png)](http://travis-ci.org/andris9/Nodemailer)
15
16 ## Nodemailer supports
17
18 * **Unicode** to use any characters
19 * **HTML content** as well as **plain text** alternative
20 * **Attachments** (including attachment **streaming** for sending larger files)
21 * **Embedded images** in HTML
efc9c37 updated readme
Andris Reinman authored
22 * **SSL/STARTTLS** for secure e-mail delivery
3c3cca5 updated readme
Andris Reinman authored
23 * Different transport methods - **SMTP**, **sendmail** and **Amazon SES**
efc9c37 updated readme
Andris Reinman authored
24 * SMTP **Connection pool** and connection reuse for rapid delivery
25 * **Preconfigured** services for using SMTP with Gmail, Hotmail etc.
21c545d @andris9 Update README.md
authored
26 * Use objects as header values for **SendGrid** SMTP API
a9acb36 Updated Readme
Andris Reinman authored
27 * **XOAUTH** authentication support and token generation (3-legged OAuth) - useful with Gmail
3c3cca5 updated readme
Andris Reinman authored
28
29 ## Check out my other mail related modules
30
31 If you want to parse generated or received e-mail instead of sending it, check
32 out [MailParser](https://github.com/andris9/mailparser).
33
34 If you only want to generate the raw e-mail stream, check out
35 [MailComposer](https://github.com/andris9/mailcomposer).
36
37 If you only want to communicate with the SMTP (both as client and the server),
38 check out [simplesmtp](https://github.com/andris9/simplesmtp).
39
7b87567 Updated readme
Andris Reinman authored
40 ## Example
41
7782176 Updated readme
Andris Reinman authored
42 This is a complete example to send an e-mail with plaintext and HTML body
7b87567 Updated readme
Andris Reinman authored
43
44 var nodemailer = require("nodemailer");
45
0d22389 @andris9 Update README.md
authored
46 // create reusable transport method (opens pool of SMTP connections)
07db51a updated sending api, backwards compatible
Andris Reinman authored
47 var smtpTransport = nodemailer.createTransport("SMTP",{
7b87567 Updated readme
Andris Reinman authored
48 service: "Gmail",
49 auth: {
50 user: "gmail.user@gmail.com",
51 pass: "userpass"
52 }
53 });
54
1f6a511 @andris9 Update README.md
authored
55 // setup e-mail data with unicode symbols
7b87567 Updated readme
Andris Reinman authored
56 var mailOptions = {
0d22389 @andris9 Update README.md
authored
57 from: "Sender Name ✔ <sender@example.com>", // sender address
7b87567 Updated readme
Andris Reinman authored
58 to: "receiver1@example.com, receiver2@example.com", // list of receivers
0d22389 @andris9 Update README.md
authored
59 subject: "Hello ✔", // Subject line
60 text: "Hello world ✔", // plaintext body
61 html: "<b>Hello world ✔</b>" // html body
7b87567 Updated readme
Andris Reinman authored
62 }
63
07db51a updated sending api, backwards compatible
Andris Reinman authored
64 // send mail with defined transport object
0d22389 @andris9 Update README.md
authored
65 smtpTransport.sendMail(mailOptions, function(error, response){
7b87567 Updated readme
Andris Reinman authored
66 if(error){
67 console.log(error);
68 }else{
0d22389 @andris9 Update README.md
authored
69 console.log("Message sent: " + response.message);
7b87567 Updated readme
Andris Reinman authored
70 }
a8d5f64 @andris9 Update README.md
authored
71 smtpTransport.close(); // shut down the connection pool, no more messages
7b87567 Updated readme
Andris Reinman authored
72 });
73
4a35e99 Readme update
Andris Reinman authored
74 See also the [examples folder](https://github.com/andris9/Nodemailer/tree/master/examples)
c4cc33b Readme update
Andris Reinman authored
75 for full featured examples
4a35e99 Readme update
Andris Reinman authored
76
3c3cca5 updated readme
Andris Reinman authored
77 ## Installation
78
79 Install through NPM
80
81 npm install nodemailer
82
83 ## Usage
84
85 Include the module
86
87 var nodemailer = require("nodemailer");
88
07db51a updated sending api, backwards compatible
Andris Reinman authored
89 An e-mail can be sent with `sendMail(mailOptions[, callback])` command
3c3cca5 updated readme
Andris Reinman authored
90
07db51a updated sending api, backwards compatible
Andris Reinman authored
91 transport.sendMail(mailOptions, callback);
3c3cca5 updated readme
Andris Reinman authored
92
93 Where
94
eb7d4fd @andris9 Update README.md
authored
95 * `transport` is a transport method defined with `nodemailer.createTransport`
efc9c37 updated readme
Andris Reinman authored
96 * **mailOptions** defines the e-mail (set its subject, body text, receivers etc.), see **E-mail Message Fields** for details
97 * **callback** is the callback function that will be run after the e-mail is sent or the sending failed (see **Return callback** for details)
3c3cca5 updated readme
Andris Reinman authored
98
99 ## Setting up a transport method
100
d3c4871 Updated readme
Andris Reinman authored
101 Before you can send any e-mails you need to set up a transport method. This can
d768813 Changed new Transport to createTransport
Andris Reinman authored
102 be done with `nodemailer.createTransport(type, options)` where `type` indicates
e328b6d updated readme
Andris Reinman authored
103 the transport protocol and `options` defines how it is used.
3c3cca5 updated readme
Andris Reinman authored
104
d768813 Changed new Transport to createTransport
Andris Reinman authored
105 var transport = nodemailer.createTransport("SMTP", {smtp_options});
3c3cca5 updated readme
Andris Reinman authored
106
107 The same transport object can and should be reused several times.
108
eb7d4fd @andris9 Update README.md
authored
109 When the transport method is defined, it can be used to send e-mail with `sendMail`
3c3cca5 updated readme
Andris Reinman authored
110
d768813 Changed new Transport to createTransport
Andris Reinman authored
111 var transport = nodemailer.createTransport("SMTP", {smtp_options});
3c3cca5 updated readme
Andris Reinman authored
112
eb7d4fd @andris9 Update README.md
authored
113 transport.sendMail({
3c3cca5 updated readme
Andris Reinman authored
114 from: "sender@tr.ee",
40b7b48 Updated readme
Andris Reinman authored
115 to: "receiver@tr.ee"
116 ...
eb7d4fd @andris9 Update README.md
authored
117 });
3c3cca5 updated readme
Andris Reinman authored
118
119 ### Possible transport methods
120
40b7b48 Updated readme
Andris Reinman authored
121 Required `type` parameter can be one of the following:
3c3cca5 updated readme
Andris Reinman authored
122
123 * **SMTP** for using SMTP
124 * **SES** for using Amazon SES
125 * **Sendmail** for utilizing systems *sendmail* command
126
127 ### Setting up SMTP
128
129 SMTP is different from the other transport mechanisms, as in its case a connection
130 pool is created. All the connections try to stay alive as long as possible and
40b7b48 Updated readme
Andris Reinman authored
131 are reusable to minimize the protocol overhead delay - for example setting up
3c3cca5 updated readme
Andris Reinman authored
132 TLS for authenticating is relatively lengthy process (in CPU terms, not by human
133 terms), you do not want to do it several times.
134
135 Possible SMTP options are the following:
136
65cfdab Updated readme
Andris Reinman authored
137 * **service** - an optional well known service identifier ("Gmail", "Hotmail" etc., see **Well known Services** for a list of supported services) to auto-configure host, port and secure connection settings
3c3cca5 updated readme
Andris Reinman authored
138 * **host** - hostname of the SMTP server (defaults to "localhost", not needed with `service`)
139 * **port** - port of the SMTP server (defaults to 25, not needed with `service`)
9f30440 Updated README about secureConnection option
Andris Reinman authored
140 * **secureConnection** - use SSL (default is `false`, not needed with `service`). If you're using port 587 then keep `secureConnection` false, since the connection is started in insecure plain text mode and only later upgraded with STARTTLS
3c3cca5 updated readme
Andris Reinman authored
141 * **name** - the name of the client server (defaults to machine name)
c075b9b Added XOAuthToken auth option for Gmail XOAUTH support
Andris Reinman authored
142 * **auth** - authentication object as `{user:"...", pass:"..."}` or `{XOAuthToken: "base64data"}`
3c3cca5 updated readme
Andris Reinman authored
143 * **ignoreTLS** - ignore server support for STARTTLS (defaults to `false`)
144 * **debug** - output client and server messages to console
145 * **maxConnections** - how many connections to keep in the pool (defaults to 5)
146
147 Example:
148
d768813 Changed new Transport to createTransport
Andris Reinman authored
149 var transport = nodemailer.createTransport("SMTP", {
3c3cca5 updated readme
Andris Reinman authored
150 service: "Gmail",
151 auth: {
152 user: "gmail.user@gmail.com",
153 pass: "userpass"
154 }
155 });
156
4a35e99 Readme update
Andris Reinman authored
157 or the same without `service` parameter
158
d768813 Changed new Transport to createTransport
Andris Reinman authored
159 var transport = nodemailer.createTransport("SMTP", {
4a35e99 Readme update
Andris Reinman authored
160 host: "smtp.gmail.com", // hostname
161 secureConnection: true, // use SSL
162 port: 465, // port for secure SMTP
163 auth: {
164 user: "gmail.user@gmail.com",
165 pass: "userpass"
166 }
167 });
168
3c3cca5 updated readme
Andris Reinman authored
169 **NB!** if you want to close the pool (cancel all open connections) you can use
170 `transport.close()`
171
d768813 Changed new Transport to createTransport
Andris Reinman authored
172 var transport = nodemailer.createTransport("SMTP",{});
3c3cca5 updated readme
Andris Reinman authored
173 ...
174 transport.close(); // close the pool
175
26794a7 Fixed XOAUTH generator defaults bug, updated README
Andris Reinman authored
176
177 #### SMTP XOAUTH and token generation
178
179 **nodemailer** supports XOAUTH authentication for SMTP. To use this, include
180 `XOAuthToken` option in `auth` instead of the regular `user` and `pass`.
181
9fdff73 updated README
Andris Reinman authored
182 var transportOptions = {
26794a7 Fixed XOAUTH generator defaults bug, updated README
Andris Reinman authored
183 ...,
184 auth: {
185 XOAuthToken: "R0VUIGh0dHBzOi8vbWFpbC5nb29...."
186 }
187 }
188
189 **nodemailer** includes also built in XOAUTH token generator which can be used
190 with `nodemailer.createXOAuthGenerator()`. The function is preconfigured for
191 Gmail, so in this case only mandatory options are `user`, `token` and `tokenSecret`.
192
193 var XOAuthTokenGenerator = nodemailer.createXOAuthGenerator({
194 user: "test.nodemailer@gmail.com",
195 // requestUrl: "https://oauth.access.point",
196 // consumerKey: "anonymous",
197 // consumerSecret: "anonymous",
198 token: "1/O_HgoO4h2uOUfpus0V--7mygICXrQQ0ZajB3ZH52KqM",
199 tokenSecret: "_mUBkIwNPnfQBUIWrJrpXJ0c"
200 });
201
202 One of `user` or `requestUrl` is mandatory. `consumerKey` and `consumerSecret` both
203 default to `"anonymous"`.
204
9fdff73 updated README
Andris Reinman authored
205 var transportOptions = {
206 service: "Gmail",
26794a7 Fixed XOAUTH generator defaults bug, updated README
Andris Reinman authored
207 auth: {
208 XOAuthToken: nodemailer.createXOAuthGenerator({
209 user: "test.nodemailer@gmail.com",
210 token: "1/O_HgoO4h2uOUfpus0V--7mygICXrQQ0ZajB3ZH52KqM",
211 tokenSecret: "_mUBkIwNPnfQBUIWrJrpXJ0c"
212 });
213 }
214 }
215
3c3cca5 updated readme
Andris Reinman authored
216 ### Setting up SES
217
218 SES is actually a HTTP based protocol, the compiled e-mail and related info
219 (signatures and such) are sent as a HTTP request to SES servers.
220
221 Possible SES options are the following:
222
223 * **AWSAccessKeyID** - AWS access key (required)
224 * **AWSSecretKey** - AWS secret (required)
2685865 Updated readme
Andris Reinman authored
225 * **ServiceUrl** - optional API end point URL (defaults to *"https://email.us-east-1.amazonaws.com"*)
3c3cca5 updated readme
Andris Reinman authored
226
227 Example:
228
d768813 Changed new Transport to createTransport
Andris Reinman authored
229 var transport = nodemailer.createTransport("SES", {
3c3cca5 updated readme
Andris Reinman authored
230 AWSAccessKeyID: "AWSACCESSKEY",
231 AWSSecretKey: "AWS/Secret/key"
232 });
233
234 ### Setting up Sendmail
235
2685865 Updated readme
Andris Reinman authored
236 Sendmail transport method streams the compiled message to the *stdin* of *sendmail*
3c3cca5 updated readme
Andris Reinman authored
237 command.
238
239 Configuration is really easy, the options parameter is optional but you can
240 use it to define the path to the *sendmail* command
241
d768813 Changed new Transport to createTransport
Andris Reinman authored
242 var transport = nodemailer.createTransport("Sendmail", "/usr/bin/sendmail");
3c3cca5 updated readme
Andris Reinman authored
243
244 ### Well known services for SMTP
93f2d1f Updated docs etc
Andris Reinman authored
245
246 If you want to use a well known service as the SMTP host, you do not need
5fef793 readme update
Andris Reinman authored
247 to enter the hostname or port number, just use the `service` parameter (**NB!** case sensitive).
93f2d1f Updated docs etc
Andris Reinman authored
248
249 Currently cupported services are:
250
251 * **"Gmail"** for Google Mail
252 * **"hot.ee"** for www.hot.ee
253 * **"Hotmail"** for Microsoft Live Hotmail
254 * **"iCloud"** for Apple iCloud
255 * **"mail.ee"** for www.mail.ee
256 * **"Postmark"** for Postmark App
257 * **"SendGrid"** for SendGrid
258 * **"SES"** for Amazon SES
259 * **"Yahoo"** for Yahoo Mail
260 * **"Zoho"** for Zoho Mail
261
3c3cca5 updated readme
Andris Reinman authored
262 Predefined service data covers `host`, `port` and secure connection settings,
263 any other parameters (ie. `auth`) need to be set separately.
93f2d1f Updated docs etc
Andris Reinman authored
264
3c3cca5 updated readme
Andris Reinman authored
265 ## E-mail message fields
93f2d1f Updated docs etc
Andris Reinman authored
266
3c3cca5 updated readme
Andris Reinman authored
267 The following are the possible fields of an e-mail message:
268
269 - **from** - The e-mail address of the sender. All e-mail addresses can be plain `sender@server.com` or formatted `Sender Name <sender@server.com>`
270 - **to** - Comma separated list of recipients e-mail addresses that will appear on the `To:` field
271 - **cc** - Comma separated list of recipients e-mail addresses that will appear on the `Cc:` field
272 - **bcc** - Comma separated list of recipients e-mail addresses that will appear on the `Bcc:` field
273 - **replyTo** - An e-mail address that will appear on the `Reply-To:` field
274 - **subject** - The subject of the e-mail
275 - **text** - The plaintext version of the message
276 - **html** - The HTML version of the message
aae3749 regenerated docs
Andris Reinman authored
277 - **generateTextFromHTML** - if set to true uses HTML to generate plain text body part from the HTML if the text is not defined
3c3cca5 updated readme
Andris Reinman authored
278 - **headers** - An object of additional header fields `{"X-Key-Name": "key value"}` (NB! values as passed as is, you should do your own encoding to 7bit if needed)
279 - **attachments** - An array of attachment objects.
9285f5c updated mailcomposer dependency to support envelope property
Andris Reinman authored
280 - **envelope** - optional SMTP envelope, if auto generated envelope is not suitable
2b9a3c9 Added messageId option
Andris Reinman authored
281 - **messageId** - optional Message-Id value, random value will be generated if not set
3c3cca5 updated readme
Andris Reinman authored
282
283 All text fields (e-mail addresses, plaintext body, html body) use UTF-8 as the encoding.
284 Attachments are streamed as binary.
285
286 Example:
287
d768813 Changed new Transport to createTransport
Andris Reinman authored
288 var transport = nodemailer.createTransport("Sendmail");
3c3cca5 updated readme
Andris Reinman authored
289
290 var mailOptions = {
291 from: "me@tr.ee",
292 to: "me@tr.ee",
293 subject: "Hello world!",
2685865 Updated readme
Andris Reinman authored
294 text: "Plaintext body"
3c3cca5 updated readme
Andris Reinman authored
295 }
296
07db51a updated sending api, backwards compatible
Andris Reinman authored
297 transport.sendMail(mailOptions);
3c3cca5 updated readme
Andris Reinman authored
298
ecfeb0e updated README for SendGrid support
Andris Reinman authored
299 ### SendGrid support
300
301 Nodemailer supports SendGrid [SMTP API](http://docs.sendgrid.com/documentation/api/smtp-api/) out of the box - you can
302 use objects as header values and these are automatically JSONized (and mime encoded if needed).
303
304 var mailOptions = {
305 ...,
306 headers: {
307 'X-SMTPAPI': {
308 category : "newuser",
309 sub:{
310 "%name%": ["Žiguli Õllepruul"]
311 }
312 }
3c9462a updated README for SendGrid support
Andris Reinman authored
313 },
314 subject: "Hello, %name%"
ecfeb0e updated README for SendGrid support
Andris Reinman authored
315 }
316
3c9462a updated README for SendGrid support
Andris Reinman authored
317 This also applies to any other service that expects a JSON string as a header value for specified key.
318
d1f45e1 @andris9 Update README.md
authored
319 ### Generate Text from HTML
320
321 If `generateTextFromHTML` option is set to true, then HTML contents of the mail is automatically converted
322 to plaintext format when plaintext content is empty or missing.
323
324 For example
325
326 mailOptions = {
327 ...,
328 generateTextFromHTML: true,
329 html: '<h1>Hello world</h1><p><b>How</b> are you?',
330 // text: '' // no text part
331 }
332
333 is automatically converted in the backround by Nodemailer to:
334
335 mailOptions = {
336 ...,
337 // source html:
338 html: '<h1>Hello world</h1><p><b>How</b> are you?',
339 // automatically generated plaintext message:
340 text: "Hello world\n"+
341 "===========\n"+
342 "\n"+
343 "**How** are you?"
344 }
345
346 As you can see the output syntax for `generateTextFromHTML` looks similar to markdown, and that
347 is exactly the case here - Nodemailer includes a simple HTML to markdown converter. But don't
348 expect too much from it, it's not full featured or perfect, just some regexes here and there.
349
3c3cca5 updated readme
Andris Reinman authored
350 ### Attachment fields
351
2685865 Updated readme
Andris Reinman authored
352 Attahcment object consists of the following properties:
3c3cca5 updated readme
Andris Reinman authored
353
354 * **fileName** - filename to be reported as the name of the attached file, use of unicode is allowed (except when using Amazon SES which doesn't like it)
355 * **cid** - optional content id for using inline images in HTML message source
356 * **contents** - String or a Buffer contents for the attachment
357 * **filePath** - path to a file if you want to stream the file instead of including it (better for larger attachments)
80bd5a3 added support for binary streams for attachments
Andris Reinman authored
358 * **streamSource** - Stream object for arbitrary binary streams if you want to stream the contents (needs to support *pause*/*resume*)
2b9a3c9 Added messageId option
Andris Reinman authored
359 * **contentType** - optional content type for the attachment, if not set will be derived from the `fileName` property
360 * **contentDisposition** - optional content disposition type for the attachment, defaults to "attachment"
3c3cca5 updated readme
Andris Reinman authored
361
80bd5a3 added support for binary streams for attachments
Andris Reinman authored
362 One of `contents`, `filePath` or `streamSource` must be specified, if none is
363 present, the attachment will be discarded. Other fields are optional.
3c3cca5 updated readme
Andris Reinman authored
364
365 Attachments can be added as many as you want.
366
4a35e99 Readme update
Andris Reinman authored
367 var mailOptions = {
368 ...
369 attachments: [
370 {
371 fileName: "text1.txt",
372 contents: "hello world!
373 },
374 {
375 fileName: "text2.txt",
376 contents: new Buffer("hello world!,"utf-8")
377 },
378 {
379 fileName: "text3.txt",
380 filePath: "/path/to/file.txt" // stream this file
381 },
382 {
80bd5a3 added support for binary streams for attachments
Andris Reinman authored
383 fileName: "text4.txt",
384 streamSource: fs.createReadStream("file.txt")
385 },
386 {
4a35e99 Readme update
Andris Reinman authored
387 fileName: "text",
388 contents: "hello world!,
389 contentType: "text/plain"
390 }
391 ]
392 }
393
3c3cca5 updated readme
Andris Reinman authored
394 ### Address Formatting
395
396 All the e-mail addresses can be plain e-mail address
397
398 username@example.com
399
400 or with formatted name (includes unicode support)
401
402 "Ноде Майлер" <username@example.com>
403
404 To, Cc and Bcc fields accept comma separated list of e-mails. Formatting can be mixed.
405
406 username@example.com, "Ноде Майлер" <username@example.com>, "Name, User" <username@example.com>
407
408 You can even use unicode domain and user names, these are automatically converted
4a35e99 Readme update
Andris Reinman authored
409 to the supported form
3c3cca5 updated readme
Andris Reinman authored
410
411 "Uncode Domain" <info@müriaad-polüteism.info>
412
9285f5c updated mailcomposer dependency to support envelope property
Andris Reinman authored
413 ### SMTP envelope
414
415 SMTP envelope is usually auto generated from `from`, `to`, `cc` and `bcc` fields but
416 if for some reason you want to specify it yourself, you can do it with `envelope` property.
417
418 `envelope` is an object with the following params: `from`, `to`, `cc` and `bcc` just like
419 with regular mail options. You can also use the regular address format.
420
421 mailOptions = {
422 ...,
423 from: "mailer@node.ee",
424 to: "daemon@node.ee",
425 envelope: {
426 from: "Daemon <deamon@node.ee>",
427 to: "mailer@node.ee, Mailer <mailer2@node.ee>"
428 }
429 }
430
3c3cca5 updated readme
Andris Reinman authored
431 ### Using Embedded Images
432
433 Attachments can be used as embedded images in the HTML body. To use this
434 feature, you need to set additional property of the attachment - `cid` (unique
435 identifier of the file) which is a reference to the attachment file. The same
436 `cid` value must be used as the image URL in HTML (using `cid:` as the URL
437 protocol, see example below).
438
439 **NB!** the cid value should be as unique as possible!
440
4a35e99 Readme update
Andris Reinman authored
441 var mailOptions = {
442 ...
443 html: "Embedded image: <img src='cid:unique@node.ee' />",
444 attachments: [{
445 filename: "image.png",
446 filePath: "/path/to/file",
447 cid: "unique@node.ee" //same cid value as in the html img src
448 }]
449 }
3c3cca5 updated readme
Andris Reinman authored
450
451 ## Return callback
452
453 Return callback gets two parameters
454
455 * **error** - an error object if the message failed
456 * **responseStatus** - an object with some information about the status on success
457
c4cc33b Readme update
Andris Reinman authored
458 Example:
459
4a35e99 Readme update
Andris Reinman authored
460 nodemailer.sendMail(mailOptions, function(error, responseStatus){
461 if(!error){
462 console.log(responseStatus.message); // response from the server
463 }
464 });
465
3c3cca5 updated readme
Andris Reinman authored
466 ## Tests
467
468 Run the tests with npm in Nodemailer's directory
469
470 npm test
471
472 There aren't currently many tests for Nodemailer but there are a lot of tests
473 in the modules that are used to generate the raw e-mail body and to use the
474 SMTP client connection.
475
476 ## Tweaking
477
478 Nodemailer in itself is actually more like a wrapper for my other modules
479 [mailcomposer](https://github.com/andris9/mailcomposer) for composing the raw message stream
480 and [simplesmtp](https://github.com/andris9/simplesmtp) for delivering it, by providing an
481 unified API. If there's some problems with particular parts of the
482 message composing/sending process you should look at the appropriate module.
483
484 ## License
485
486 **Nodemailer** is licensed under [MIT license](https://github.com/andris9/Nodemailer/blob/master/LICENSE). Basically you can do whatever you want to with it.
Something went wrong with that request. Please try again.