email

package
v0.0.0-...-e53d801 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 7 Imported by: 0

README

email

Getting started

Documentation
type Mail struct {
  host     string //smtp server host
  port     int    //smtp server port
  username string //smtp auth username
  password string //smtp auth passworld

  sender string

  callBack func(ids string, sendErr, linkErr error) //async send callback
}
  • AsyncSendMail() 异步发送邮件,可以在Mail 中设置 callback
  • SendMail() 发送邮件,等待发送返回

Example broadcast

具体代码请参考example文件夹

  1. 填写smtp服务地址端口以及认证的用户名密码

    index

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mail

type Mail struct {
	// contains filtered or unexported fields
}

func NewMail

func NewMail(host string, port int, userName, password, sender string) *Mail

func (*Mail) AsyncSendMail

func (m *Mail) AsyncSendMail(emails, ids []string, title, htmlBody string, attachment []string) error

AsyncSendMail 发送邮件

func (*Mail) SendEmail

func (m *Mail) SendEmail(email, title, htmlBody string, attachment []string) error

SendEmail 阻塞发送邮件

func (*Mail) SetCallBack

func (m *Mail) SetCallBack(callBack func(ids string, sendErr, linkErr error))

func (*Mail) SetSender

func (m *Mail) SetSender(sender string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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