Documentation
¶
Index ¶
- type Smtp
- func (e *Smtp) AddHeader(key, value string) *Smtp
- func (e *Smtp) AddToAddress(address string) *Smtp
- func (e *Smtp) Clone() internal.Configurable
- func (e *Smtp) DisableTLS() *Smtp
- func (e *Smtp) EnableTLSService() *Smtp
- func (e *Smtp) Get() interface{}
- func (e *Smtp) Set(data interface{})
- func (e *Smtp) Validate() error
- func (e *Smtp) WithEnabled(enabled bool) *Smtp
- func (e *Smtp) WithFromAddress(address string) *Smtp
- func (e *Smtp) WithModuleName(name string) *Smtp
- func (e *Smtp) WithPassword(password string) *Smtp
- func (e *Smtp) WithPoolSize(size int) *Smtp
- func (e *Smtp) WithSMTPHost(host string) *Smtp
- func (e *Smtp) WithSMTPPort(port int) *Smtp
- func (e *Smtp) WithUsername(username string) *Smtp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Smtp ¶
type Smtp struct {
ModuleName string `mapstructure:"module-name" yaml:"module-name" json:"moduleName"` // 模块名称
Enabled bool `mapstructure:"enabled" yaml:"enabled" json:"enabled"` // 是否启用
SMTPHost string `mapstructure:"smtp-host" yaml:"smtp-host" json:"smtpHost"` // SMTP主机
SMTPPort int `mapstructure:"smtp-port" yaml:"smtp-port" json:"smtpPort"` // SMTP端口
Username string `mapstructure:"username" yaml:"username" json:"username"` // 用户名
Password string `mapstructure:"password" yaml:"password" json:"password"` // 密码
FromAddress string `mapstructure:"from-address" yaml:"from-address" json:"fromAddress"` // 发件人地址
ToAddresses []string `mapstructure:"to-addresses" yaml:"to-addresses" json:"toAddresses"` // 收件人地址列表
EnableTLS bool `mapstructure:"enable-tls" yaml:"enable-tls" json:"enableTls"` // 是否启用TLS
Headers map[string]string `mapstructure:"headers" yaml:"headers" json:"headers"` // 自定义头部
PoolSize int `mapstructure:"pool-size" yaml:"pool-size" json:"poolSize"` // 连接池大小
}
Smtp 邮箱配置
func (*Smtp) WithFromAddress ¶
WithFromAddress 设置发件人地址
func (*Smtp) WithModuleName ¶
WithModuleName 设置模块名称
Click to show internal directories.
Click to hide internal directories.