1.1.0 • Published 4 years ago

send-mail-for-test v1.1.0

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

send-mail-for-test

描述

使用nodemailer套件模組化 SMTP Email 寄送功能,降低未來維護的成本。

功能

  1. SMTP Server 的位置與身份驗證是可變動的
  2. 需可寄送 HTML 內文
  3. 內文可附加圖片
  4. 可夾帶檔案

install

    npm install send-mail-for-test --save

constructor

    const param: MailCredentialParameter = {
        host: "smtp.gmail.com",
        port: 465,
        enableSSL: true,
        user: "user@gmail.com",
        password: "password"
    };

    const mailUtil = new MailUtil(param);

function

    const option: MailOptionParameter = {
    from: "from@gmail.com",
    to: ["to@gmail.com"],
    subject: "test",
    text:"hi",
    attachments: [{
        filename: "",
        path:""
    }, {
        filename: "",
        path:"",
        cid: "" // if want to show image
    }]};

    mailUtil.sendMail(option).then((res: Result) => {
        console.log(res);
    });
1.1.0

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago