Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Enabled bool `yaml:"enabled" env:"EMAIL_ENABLED" default:"true"`
Host string `yaml:"host" env:"EMAIL_HOST" default:"localhost"`
Port int `yaml:"port" env:"EMAIL_PORT" default:"587"`
Username string `yaml:"username" env:"EMAIL_USERNAME" required:"true"`
Password string `yaml:"password" env:"EMAIL_PASSWORD" required:"true"`
From string `yaml:"from" env:"EMAIL_FROM" required:"true"`
EnableTLS bool `yaml:"enable_tls" env:"EMAIL_ENABLE_TLS" default:"true"`
Timeout pkgConfig.Duration `yaml:"timeout" env:"EMAIL_TIMEOUT" default:"30s"`
EnableTrace bool `yaml:"enable_trace" env:"EMAIL_ENABLE_TRACE" default:"true"`
}
Config 邮件配置结构体(用于从配置文件创建)
func (*Config) TimeoutDuration ¶
TimeoutDuration 返回 time.Duration 类型的 Timeout
type EmailClient ¶
type EmailClient struct {
// contains filtered or unexported fields
}
EmailClient 邮件客户端
func (*EmailClient) Send ¶
func (e *EmailClient) Send(ctx context.Context, msg *Message) error
Send 发送邮件(自动处理追踪)
func (*EmailClient) SendSimple ¶
SendSimple 发送简单邮件(只包含收件人、主题和正文)
Click to show internal directories.
Click to hide internal directories.