Gomail

在Go中发送电子邮件的最佳方式。(The best way to send emails in Go.)

  • 所有者: go-gomail/gomail
  • 平台: BSD, Linux, Mac, Windows
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

Gomail

Build Status Code Coverage Documentation

Introduction

Gomail is a simple and efficient package to send emails. It is well tested and
documented.

Gomail can only send emails using an SMTP server. But the API is flexible and it
is easy to implement other methods for sending emails using a local Postfix, an
API, etc.

It is versioned using gopkg.in so I promise
there will never be backward incompatible changes within each version.

It requires Go 1.2 or newer. With Go 1.5, no external dependencies are used.

Features

Gomail supports:

  • Attachments
  • Embedded images
  • HTML and text templates
  • Automatic encoding of special characters
  • SSL and TLS
  • Sending multiple emails with the same SMTP connection

Documentation

https://godoc.org/gopkg.in/gomail.v2

Download

go get gopkg.in/gomail.v2

Examples

See the examples in the documentation.

FAQ

x509: certificate signed by unknown authority

If you get this error it means the certificate used by the SMTP server is not
considered valid by the client running Gomail. As a quick workaround you can
bypass the verification of the server's certificate chain and host name by using
SetTLSConfig:

package main

import (
	"crypto/tls"

	"gopkg.in/gomail.v2"
)

func main() {
	d := gomail.NewDialer("smtp.example.com", 587, "user", "123456")
	d.TLSConfig = &tls.Config{InsecureSkipVerify: true}

    // Send emails using d.
}

Note, however, that this is insecure and should not be used in production.

Contribute

Contributions are more than welcome! See CONTRIBUTING.md for
more info.

Change log

See CHANGELOG.md.

License

MIT

Contact

You can ask questions on the Gomail
thread

in the Go mailing-list.

主要指标

概览
名称与所有者go-gomail/gomail
主编程语言Go
编程语言Go (语言数: 1)
平台BSD, Linux, Mac, Windows
许可证MIT License
所有者活动
创建于2014-10-15 15:47:48
推送于2023-03-31 22:30:16
最后一次提交2016-04-11 23:29:32
发布数1
最新版本名称2.0.0 (发布于 2015-09-02 13:59:03)
第一版名称2.0.0 (发布于 2015-09-02 13:59:03)
用户参与
星数4.6k
关注者数70
派生数589
提交数90
已启用问题?
问题数164
打开的问题数90
拉请求数1
打开的拉请求数18
关闭的拉请求数26
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?