smtp

package
Version: v0.0.0-...-3db7acb Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: Apache-2.0 Imports: 5 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)

Dial return a smtp client

func SendMail

func SendMail(host, user, password, to, subject, body, mailtype string) error

SendMail send email

func SendMailUsingTLS

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

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

Types

type Email

type Email struct {
	Host     string
	User     string
	Password string
	To       string
	Subject  string
	Body     string
	MailType string
}

Email email struct

func (*Email) Send

func (email *Email) Send(to, subject, body, mailtype string) error

Send send email

func (*Email) Server

func (email *Email) Server(host, user, password string) bool

Server set email server

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL