1- # mailbuild
1+ # emailjs-mime-builder
22
3- * mailbuild * is a low level rfc2822 message composer. Define your own mime tree, no magic included.
3+ * emailjs-mime-builder * is a low level rfc2822 message composer. Define your own mime tree, no magic included.
44
5- [ ![ Build Status] ( https://travis-ci.org/whiteout-io/mailbuild .png?branch=master )] ( https://travis-ci.org/whiteout-io/mailbuild )
5+ [ ![ Build Status] ( https://travis-ci.org/emailjs/emailjs-mime-builder .png?branch=master )] ( https://travis-ci.org/emailjs/emailjs-mime-builder )
66
77## StringEncoding API
88
@@ -18,18 +18,18 @@ This module requires `TextEncoder` and `TextDecoder` to exist as part of the Str
1818
1919This module has dependencies that will be fetched automatically.
2020
21- * [ mimefuncs ] ( https://github.com/whiteout-io/mimefuncs / )
22- * [ mimetypes ] ( https://github.com/whiteout-io/mimetypes / )
23- * [ addressparser] ( https://github.com/whiteout-io/ addressparser/ )
21+ * [ emailjs-mime-codec ] ( https://github.com/emailjs/emailjs-mime-codec / )
22+ * [ emailjs-mime-types ] ( https://github.com/emailjs/emailjs-mime-types / )
23+ * [ emailjs- addressparser] ( https://github.com/emailjs/emailjs- addressparser/ )
2424* [ punycode.js] ( https://github.com/bestiejs/punycode.js )
25- * [ stringencoding] ( https://github.com/whiteout-io/ stringencoding )
25+ * [ emailjs- stringencoding] ( https://github.com/emailjs/emailjs- stringencoding )
2626
2727## API
2828
29- Create a new ` Mailbuild ` object with
29+ Create a new ` MimeBuilder ` object with
3030
3131``` javascript
32- var builder = new Mailbuild (contentType [, options]);
32+ var builder = new MimeBuilder (contentType [, options]);
3333```
3434
3535Where
4141
4242## Methods
4343
44- The same methods apply to the root node created with ` new Mailbuild () ` and to any child nodes.
44+ The same methods apply to the root node created with ` new MimeBuilder () ` and to any child nodes.
4545
4646### createChild
4747
@@ -51,12 +51,12 @@ Creates and appends a child node to the node object
5151node .createChild (contentType, options)
5252```
5353
54- The same arguments apply as with ` new Mailbuild () ` . Created node object is returned.
54+ The same arguments apply as with ` new MimeBuilder () ` . Created node object is returned.
5555
5656** Example**
5757
5858``` javascript
59- new Mailbuild (" multipart/mixed" ).
59+ new MimeBuilder (" multipart/mixed" ).
6060 createChild (" multipart/related" ).
6161 createChild (" text/plain" );
6262```
@@ -86,8 +86,8 @@ Method returns appended child node.
8686** Example**
8787
8888``` javascript
89- var childNode = new Mailbuild (" text/plain" ),
90- rootNode = new Mailbuild (" multipart/mixed" );
89+ var childNode = new MimeBuilder (" text/plain" ),
90+ rootNode = new MimeBuilder (" multipart/mixed" );
9191rootnode .appendChild (childNode);
9292```
9393
@@ -115,9 +115,9 @@ Method returns replacement node.
115115** Example**
116116
117117``` javascript
118- var rootNode = new Mailbuild (" multipart/mixed" ),
118+ var rootNode = new MimeBuilder (" multipart/mixed" ),
119119 childNode = rootNode .createChild (" text/plain" );
120- childNode .replace (new Mailbuild (" text/html" ));
120+ childNode .replace (new MimeBuilder (" text/html" ));
121121```
122122
123123Generates the following mime tree:
@@ -141,7 +141,7 @@ Method returns removed node.
141141
142142``` javascript
143143
144- var rootNode = new Mailbuild (" multipart/mixed" ),
144+ var rootNode = new MimeBuilder (" multipart/mixed" ),
145145 childNode = rootNode .createChild (" text/plain" );
146146childNode .remove ();
147147```
@@ -173,7 +173,7 @@ Method returns current node.
173173** Example**
174174
175175``` javascript
176- new Mailbuild (" text/plain" ).
176+ new MimeBuilder (" text/plain" ).
177177 setHeader (" content-disposition" , " inline" ).
178178 setHeader ({
179179 " content-transfer-encoding" : " 7bit"
@@ -214,7 +214,7 @@ Method returns current node.
214214** Example**
215215
216216``` javascript
217- new Mailbuild (" text/plain" ).
217+ new MimeBuilder (" text/plain" ).
218218 addHeader (" X-Spam" , " 1" ).
219219 setHeader ({
220220 " x-spam" : " 2"
@@ -248,7 +248,7 @@ Where
248248** Example**
249249
250250``` javascript
251- new Mailbuild (" text/plain" ).getHeader (" content-type" ); // text/plain
251+ new MimeBuilder (" text/plain" ).getHeader (" content-type" ); // text/plain
252252```
253253
254254## setContent
@@ -267,7 +267,7 @@ Where
267267** Example**
268268
269269``` javascript
270- new Mailbuild (" text/plain" ).setContent (" Hello world!" );
270+ new MimeBuilder (" text/plain" ).setContent (" Hello world!" );
271271```
272272
273273## build
@@ -283,7 +283,7 @@ Method returns the rfc2822 message as a string
283283** Example**
284284
285285``` javascript
286- new Mailbuild (" text/plain" ).setContent (" Hello world!" ).build ();
286+ new MimeBuilder (" text/plain" ).setContent (" Hello world!" ).build ();
287287```
288288
289289Returns the following string:
@@ -310,7 +310,7 @@ Method returns the envelope in the form of `{from:'address', to: ['addresses']}`
310310** Example**
311311
312312``` javascript
313- new Mailbuild ().
313+ new MimeBuilder ().
314314 addHeader ({
315315 from: " From <from@example.com>" ,
316316 to: " receiver1@example.com" ,
@@ -340,7 +340,7 @@ the addresses are converted to punycode automatically.
340340For attachments you should minimally set ` filename ` option and ` Content-Disposition ` header. If filename is specified, you can leave content type blank - if content type is not set, it is detected from the filename.
341341
342342``` javascript
343- new Mailbuild (" multipart/mixed" ).
343+ new MimeBuilder (" multipart/mixed" ).
344344 createChild (false , {filename: " image.png" }).
345345 setHeader (" Content-Disposition" , " attachment" );
346346```
0 commit comments