|
|
|
"readme": "# emailjs [](http://travis-ci.org/eleith/emailjs)\n\nsend emails, html and attachments (files, streams and strings) from node.js to any smtp server\n\n## INSTALLING\n\n\tnpm install emailjs\n\n## FEATURES\n - works with SSL and TLS smtp servers \n - supports smtp authentication (PLAIN, LOGIN, CRAMMD5)\n - emails are queued and the queue is sent asynchronously\n - supports sending html emails and emails with multiple attachments (MIME)\n - attachments can be added as strings, streams or file paths\n - supports utf-8 headers and body\n\n## REQUIRES\n - auth access to an SMTP Server\n - if your service (ex: gmail) uses two-step authentication, use an applicaiton specific password\n\n## EXAMPLE USAGE - text only emails\n\n```javascript\nvar email \t= require(\"./path/to/emailjs/email\");\nvar server \t= email.server.connect({\n user: \"username\", \n password:\"password\", \n host: \"smtp.your-email.com\", \n ssl: true\n});\n\n// send the message and get a callback with an error or details of the message that was sent\nserver.send({\n text: \"i hope this works\", \n from: \"you <username@your-email.com>\", \n to: \"someone <someone@your-email.com>, another <another@your-email.com>\",\n cc: \"else <else@your-email.com>\",\n subject: \"testing emailjs\"\n}, function(err, message) { console.log(err || message); });\n```\n\n## EXAMPLE USAGE - html emails and attachments\n\n```javascript\nvar email \t= require(\"./path/to/emailjs/email\");\nvar server \t= email.server.connect({\n user:\t\"username\", \n password:\"password\", \n host:\t\"smtp.your-email.com\", \n ssl:\t\ttrue\n});\n\nvar message\t= {\n text:\t\"i hope this works\", \n from:\t\"you <username@your-email.com>\", \n to:\t\t\"someone <someone@your-email.com>, another <another@your-email.com>\",\n cc:\t\t\"else <else@your-email.com>\",\n subject:\t\"testing emailjs\",\n attachment: \n [\n {data:\"<html>i <i>hope</i> this works!</html>\", alternative:true},\n {path:\"path/to/file.zip\", type:\"application/zip\", name:\"renamed.zip\"}\n ]\n};\n\n// send the message and get a callback with an error or details of the message that was sent\nserver.send(message, function(err, message) { console.log(err || message); });\n\n// you can continue to send more messages with successive calls to 'server.send', \n// they will be queued on the same smtp connection\n\n// or you can create a new server connection with 'email.server.connect' \n// to asynchronously send individual emails instead of a queue\n```\n\n## EXAMPLE USAGE - sending through hotmail/outlook\n\n```javascript\nvar email \t= require(\"./path/to/emailjs/email\");\nvar server \t= email.server.connect({\n user:\t\"username\", \n password:\"password\", \n host:\t\"smtp-mail.outlook.com\", \n tls: {ciphers: \"SSLv3\"}\n});\n\nvar message\t= {\n text:\t\"i hope this works\", \n from:\t\"you <username@outlook.com>\", \n to:\t\t\"someone <someone@your-email.com>, another <another@your-email.com>\",\n cc:\t\t\"else <else@your-email.com>\",\n subject:\t\"testing emailjs\",\n attachment: \n [\n {data:\"<html>i <i>hope</i> this works!</html>\", alternative:true},\n {path:\"path/to/file.zip\", type:\"application/zip\", name:\"renamed.zip\"}\n ]\n};\n\n// send the message and get a callback with an error or details of the message that was sent\nserver.send(message, function(err, message) { console.log(err || message); });\n```\n\n# API \n\n## email.server.connect(options)\n\n\t// options is an object with the following keys\n\toptions =\n\t{\n\t\tuser \t\t// username for logging into smtp \n\t\tpassword // password for logging into smtp\n\t\thost\t\t// smtp host\n\t\tport\t\t// smtp port (if null a standard port number will be used)\n\t\tssl\t\t// boolean or object {key, ca, cert} (if true or object, ssl connection will be made)\n\t\ttls\t\t// boolean or object (if true or object, starttls will be initiated)\n\t\ttimeout\t// max number of millis
|