Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotInitialized = fmt.Errorf("mailer is not initialized") ErrInvalidConfig = fmt.Errorf("invalid mail config") )
预定义错误
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
Attachment 邮件附件
type Config ¶
type Config struct {
Host string // SMTP 服务器地址
Port int // SMTP 端口
Username string // SMTP 用户名
Password string // SMTP 密码
FromAddress string // 发件人地址
FromName string // 发件人名称
UseTLS bool // 是否启用 TLS
}
Config 邮件配置
type Mailer ¶
type Mailer struct {
// contains filtered or unexported fields
}
Mailer 邮件发送器,封装 go-mail 提供通用邮件发送能力
func (*Mailer) Close ¶
Close 关闭邮件客户端,释放连接资源。 关闭后 Mailer 不可再使用,再次调用 Send 将返回 ErrNotInitialized。 可安全多次调用。
func (*Mailer) SendMessage ¶
SendMessage 发送自定义邮件,支持抄送、密送、附件、回复地址等扩展功能
Click to show internal directories.
Click to hide internal directories.