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

@coolgk/email

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coolgk/email

email sender

  • 1.0.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-82.61%
Maintainers
1
Weekly downloads
 
Created
Source

@coolgk/email

a javascript / typescript module

npm install @coolgk/email

email sender

Examples

import { Email } from '@coolgk/email';
// OR
// const { Email } = require('@coolgk/email');

const email = new Email({host: 'localhost'});

email.send({
    subject: 'hello this is email subject',
    from: {
            name: 'Daniel Gong',
            email: 'daniel.k.gong@example.com'
    },
    to: [
        {
            name: 'Dan Go',
            email: 'dan@example.com'
        },
        'gong@example.com'
    ],
    message: '<html><body><h1>test</h1>some message here
        <img src="cid:my-image" width="500" height="250"></body></html>',
    attachments: [
        {
            path: '/tmp/test.png',
            name: 'screenshot.png'
        },
        {
            path:"/tmp/test.png",
            headers:{"Content-ID": "<my-image>"}
        }
    ]
}).then((sentMessage) => {
    console.log(sentMessage);
}).catch((error) => {
    console.log(error);
});

Email

Kind: global class
See: https://www.npmjs.com/package/emailjs#emailserverconnectoptions

new Email(options)

ParamTypeDefaultDescription
optionsobject
[options.stripTags]function./stripTags.js
[options.user]stringusername for logging into smtp
[options.password]stringpassword for logging into smtp
[options.host]string"'localhost'"smtp host
[options.port]stringsmtp port (if null a standard port number will be used)
[options.ssl]booleanboolean (if true or object, ssl connection will be made)
[options.tls]booleanboolean (if true or object, starttls will be initiated)
[options.domain]stringdomain to greet smtp with (defaults to os.hostname)
[options.authentication]Array.<string>authentication methods

email.send(options, [attachments]) ⇒ promise

Kind: instance method of Email

ParamTypeDescription
optionsobject
options.subjectstringemail subject
[options.message]stringhtml email message
options.toArray.<(string|object)>to email address
options.to[].namestringname of the recipient
options.to[].emailstringemail address of the recipient
[options.from]string | objectsee options.to
[options.cc]Array.<(string|object)>see options.to
[options.bcc]Array.<(string|object)>see options.to
[attachments]Array.<object>email attachments
attachments.pathstringfile path
[attachments.name]stringfile name
[attachments.type]stringfile mime type
[attachments.method]stringmethod to send attachment as (used by calendar invites)
[attachments.headers]objectattachment headers, header: value pairs, e.g. {"Content-ID":""}

Keywords

FAQs

Package last updated on 13 Jan 2018

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