mailx

package
v0.0.0-...-61a7dbd Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidMailAddress

func ValidMailAddress(addr string) bool

Types

type Conf

type Conf struct {
	Server        string `yaml:"server"`
	SupportDomain string `yaml:"supportDomain"`
}

type ISender

type ISender interface {
	Send(config Server, param Param) error
}

ISender 邮件发送接口

type Param

type Param struct {
	To      []string
	Subject string
	Body    string
	Cc      []string
	Bcc     []string
}

Param 发送参数

func (Param) CheckValid

func (p Param) CheckValid() error

type SendReq

type SendReq struct {
	Appid   string         `json:"appid"`
	Code    string         `json:"code"`
	Subject string         `json:"subject"`
	To      []string       `json:"to"`
	Params  map[string]any `json:"params"`
}

type Sender

type Sender struct {
	Log *logx.Logger
	// contains filtered or unexported fields
}

Sender 邮件发送实现

func NewSender

func NewSender(log *logx.Logger, conf Conf) *Sender

func (*Sender) Send

func (s *Sender) Send(server Server, param Param) error

func (*Sender) SendVerifyCode

func (s *Sender) SendVerifyCode(redis redisx.Client, to string, Type string)

type Server

type Server struct {
	Host     string
	Port     int
	From     string
	UserName string
	Password string
}

Server 邮件服务配置

func (Server) CheckValid

func (c Server) CheckValid() error

Jump to

Keyboard shortcuts

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