Giter VIP home page Giter VIP logo

fibjs-mail's Introduction

邮件内容组装,以及fibjs-smtp发送

fibjs-smtp-simple-use
var s = net.openSmtp("tcp://smtp.qq.com:25");
s.login('[email protected]', 'yourqq_account_auth_smtp_key');
s.command('HELO','localhost');
s.command('MAIL FROM:','[email protected]');
s.command('RCPT TO:','[email protected]');
s.data('hi, i am simple data. @by fibjs');
s.quit();

use-mime


const MailSender = require("fibjs-mail").MailSender;
const MailPop3 = require("fibjs-mail").MailPop3;  
var mailData = new MailData();
mailData.recipients = [{name:'demo_a',addr:"[email protected]"},{name:'demo_b',addr:"[email protected]"},{name:'demo_c',addr:"[email protected]",type:'Cc'}];
mailData.message = "Hello I am Fiber. lalalalala.";
mailData.subject = "i am a demo";
mailData.replys = [{name: 'demo_reply', addr:"[email protected]"}];
mailData.attachments = [{
    type:"image/jpeg",
    filename:"screen20200801.jpg",
    base64Data:require("fs").readFile("E:/tmp/20200801.jpg").toString("base64")
}];

var sender=new MailSender('[email protected]', 'yourqq_account_auth_smtp_key');
sender.send(mailData)  


use pop3


const MailPop3 = require("fibjs-mail").MailPop3;  
const parseMailData = require("fibjs-mail").parseMailData;  
var reader=new MailPop3("tcp://pop.qq.com:110",{user:"[email protected]",pass:"authcode"});  
console.log(reader.list())   
let mime_str=reader.retr(1);
//简单解析邮件内容(不保证完全解析正确
console.log(parseMailData(mime_str))  

bug report
https://github.com/lhkzh/fibjs-mail/issues

fibjs-mail's People

Contributors

exiaolv avatar lhkzh avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.