Skip to content

Mttylzq/ali-email

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nodejs SDK for Aliyun DirectMail service

Install

npm install ali-email

Usage

###SingleSendMail

var aliEmail = require("ali-email");
var accessKeyID     = process.env.ALI_SMS_ACCESSKEYID ;
var accessKeySecret = process.env.ALI_SMS_ACCESSKEYSECRET ;

var configSingle = {
    action            :'SingleSendMail',
    accessKeyID       : accessKeyID,
    accessKeySecret   : accessKeySecret,
    accountName       :'[email protected]',
    replyToAddress    :true,
    addressType       :0,
    toAddress         :'[email protected]',
    fromAlias         :'sendEmailFromAlias',
    subject           :'subject',
    textBody          :'test'
};
aliEmail(configSingle, function(err, body) {
    console.log(err);
    console.log(body);
});

###BatchSendMail

var aliEmail = require("ali-email");
var accessKeyID     = process.env.ALI_SMS_ACCESSKEYID ;
var accessKeySecret = process.env.ALI_SMS_ACCESSKEYSECRET ;

var configSingle = {
    action            :'BatchSendMail',
    accessKeyID       : accessKeyID,
    accessKeySecret   : accessKeySecret,
    accountName       :'[email protected]',
    templateName      :'test',
    receiversName      :'test',
};
aliEmail(configSingle, function(err, body){
    console.log(err);
    console.log(body);
});

Config

Aliyun DirectMail service

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published