Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

emailjs

Package Overview
Dependencies
Maintainers
0
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

emailjs

send emails, html and attachments from node.js to any smtp server

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
29K
increased by32.13%
Maintainers
0
Weekly downloads
 
Created
Source

#v0.1

###send emails, html and attachments from node.js to any smtp server

Installing

 npm install emailjs

FEATURES

  • works with SSL smtp servers (ex: gmail)
  • works with smtp server authentication (PLAIN, LOGIN, CRAMMD5)
  • emails are queued and the queue is sent asynchronously
  • supports sending html emails and emails with multiple attachments
  • works with nodejs 3.8 and above

REQUIRES

  • access to an SMTP Server (ex: gmail)

USAGE - text only emails

	var email 	= require("./path/to/emailjs/email");
	var server 	= email.server.connect({
		user:yourUSER, 
		password:yourPASS, 
		host:"smtp.gmail.com", 
		port:465, 
		domain:yourDOMAIN, 
		secure:true});

	// send the message and get a callback with an error or details of the message that was sent
	server.send({
		text:"i hope this works", 
		from:yourUSER + "@gmail.com", 
		to:yourFRIEND, 
		subject:"testing emailjs"}, 
		function(err, message) { 
			console.log(err || message); 
		});

USAGE - html emails and attachments

	var email 	= require("./path/to/emailjs/email");
	var server 	= email.server.connect({
		user:yourUSER, 
		password:yourPASS, 
		host:"smtp.gmail.com", 
		port:465, 
		domain:yourDOMAIN, 
		secure:true});

	var message	= email.message.create("i hope this works", {from:yourUSER + "@gmail.com", to:yourFRIEND, subject:"testing emailjs"});

	// attach an alternative html email for those with advanced email clients
	message.attach_alternative("i <i>hope</i> this works!");

	// attach attachments because you can!
	message..attach("path/to/file.zip", "application/zip", "renamed.zip");

	// send the message and get a callback with an error or details of the message that was sent
	server.send(message, function(err, message) { console.log(err || message); });

	// you can continue to send more messages with successive calls to 'server.send', they will be queued on the same smtp connection
	// or you can create a new server connection with 'email.server.connect' to async send individual emails instead of a queue

Authors

eleith

FAQs

Package last updated on 23 Feb 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc