mail

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2022 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(addr string) (*smtp.Client, error)

return a smtp client

func NewPanicHTMLEmail

func NewPanicHTMLEmail(method, host, uri string, msg interface{}, stack string) (subject string, body string, err error)

NewPanicHTMLEmail 发送系统异常邮件 html

func Send

func Send(o *Options) error

func SendEmail

func SendEmail(o *Email) error

SSL方式发送邮件

func SendMailUsingTLS

func SendMailUsingTLS(addr string, auth smtp.Auth, from string, to []string, msg []byte) (err error)

参考net/smtp的func SendMail() 使用net.Dial连接tls(ssl)端口时,smtp.NewClient()会卡住且不提示err len(to)>1时,to[1]开始提示是密送

Types

type Email

type Email struct {
	Host    string
	Port    int
	User    string
	Pass    string
	Sender  string
	Subject string
	Body    string
	To      string
}

type Options

type Options struct {
	MailHost string
	MailPort int
	MailUser string // 发件人
	MailPass string // 发件人密码
	MailTo   string // 收件人 多个用,分割
	Subject  string // 邮件主题
	Body     string // 邮件内容
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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