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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?