Git Product home page Git Product logo

email.v2's Introduction

email.v2

Yet another SMTP client!

GoDoc

SMTP Logging

Features

This package currently supports the following:

  • From, To, Bcc, and Cc fields
  • Email addresses in both "[email protected]" and "First Last <[email protected]>" format
  • Text and HTML Message Body
  • Attachments
  • Read Receipts
  • Custom Headers
  • SMTP Logging
  • Integrated Client Settings

Installation

go get github.com/BourgeoisBear/email.v2

Simple Usage

oCfg := SMTPClientConfig{
  Server:   "mx.test.com",
  Port:     587,
  Username: "[email protected]",
  Password: "...",
  Mode:     ModeSTARTTLS,
  // SMTPLog:  "-",  // note: uncomment to log SMTP session to STDOUT
}

oEmail := NewEmail()
oEmail.From    = "[email protected]"
oEmail.To      = []string{"[email protected]"}
oEmail.Subject = "Test Message"
oEmail.Text    = []byte("Whoomp there it is!")

E := oCfg.SimpleSend(oEmail)
if E != nil { return E }

Reasons for Fork

This is a fork of https://github.com/jordan-wright/email

  • ripped out connection pooling (sending via long-term connections to SMTP servers has not been reliable)
  • condensed multiple Send... methods into NewClient() & Send() to
    • provide a more generic way of establishing unauthenticated, SSL, and STARTTLS connections
    • send multiple messages from within a single established SMTP session
    • make direct use of outside net.Conn interfaces, so as to set dial and I/O deadlines
  • added LoginAuth authentication interface for use with Office 365
  • added TextprotoLogged for full logging of SMTP traffic

Testing

To run unit tests, add the proper credentials to email_test_settings.json for accounts you choose to test with. Examples for O365, GMAIL, & CUSTOM have been provided.

email.v2's People

Contributors

barnjamin avatar bourgeoisbear avatar bughou avatar chborges avatar cristaloleg avatar diligiant avatar ichinaski avatar ifraixedes avatar jeddenlea avatar jeremywohl avatar jessta avatar jordan-wright avatar maddyblue avatar mgrachev avatar quasilyte avatar rolandshoemaker avatar teepark avatar ursc avatar wscherphof avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  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.