xmail

package
v0.20.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

README

GoKit - xmail

Mail kits for Golang development.

Features

  • Light weight and Easy to use
  • Attachment sending support
  • Plain text sending support
  • TLS sending support

Installation

go get -u github.com/likexian/gokit

Importing

import (
    "github.com/likexian/gokit/xmail"
)

Documentation

Visit the docs on GoDoc

Example

Send mail
// Set the smtp info
// New("smtp server:port", "smtp username", "smtp password", isTLS)
m := New("smtp.likexian.com:465", "i@likexian.com", "8Bd0a7681333214", true)

// Set email from
m.From("i@likexian.com")

// Set send to
m.To("to@likexian.com")

// Set send cc
m.Cc("cc@likexian.com")

// Set send bcc
m.BCc("bcc@likexian.com")

// set mail content type
m.ContentType("text/html")

// Set mail subject
m.Content("Mailer Test", "xmail via github.com/likexian/gokit/xmail.<br /><img src=\"cid:xmail_test.jpg\" />")

// Add attachment
err := m.Attach("xmail_test.jpg")
if err != nil {
    panic(err)
}

err = m.Send()
if err != nil {
    panic(err)
}

LICENSE

Copyright 2012-2019 Li Kexian

Licensed under the Apache License 2.0

About

DONATE

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Author

func Author() string

Author returns package author

func License

func License() string

License returns package license

func New

func New(server, username, password string, tls bool) (m *message)

New returns a new xmail

func Version

func Version() string

Version returns package version

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL