mail

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSender

func NewSender(conf *Config) (notify.MailSender, error)

NewSender todo

Types

type Config

type Config struct {
	Host         string      `bson:"host" json:"host" env:"K_EMAIL_HOST"`
	AuthUserName string      `bson:"username" json:"username" env:"K_EMAIL_USERNAME"`
	AuthPassword string      `bson:"password" json:"password,omitempty" env:"K_EMAIL_PASSWORD"`
	AuthSecret   string      `bson:"secret" json:"secret,omitempty" env:"K_EMAIL_SECRET"`
	AuthIdentity string      `bson:"identity" json:"identity,omitempty" env:"K_EMAIL_IDENTITY"`
	Hello        string      `bson:"hello" json:"hello,omitempty" env:"K_EMAIL_HELLO"`
	From         string      `bson:"from" json:"from,omitempty" env:"K_EMAIL_FROM"`
	SkipAuth     bool        `bson:"skip_auth" json:"skip_auth" env:"K_EMAIL_SKIP_AUTH"`
	RequireTLS   bool        `bson:"require_tls" json:"require_tls" env:"K_EMAIL_REQUIRE_TLS"`
	TLSConfig    *tls.Config `bson:"tls_config" json:"tls_config"`
}

Config todo

func LoadConfigFromEnv

func LoadConfigFromEnv() (*Config, error)

LoadConfigFromEnv todo

func NewDefaultConfig

func NewDefaultConfig() *Config

NewDefaultConfig todo

func NewEmailConfig

func NewEmailConfig(host, user, pass string) *Config

NewEmailConfig todo

func (*Config) Desensitize

func (c *Config) Desensitize()

Desensitize 脱敏

func (*Config) Validate

func (c *Config) Validate() error

Validate todo

type TestSendRequest

type TestSendRequest struct {
	*notify.SendMailRequest
	*Config
}

TestSendRequest todo

func NewDeaultTestSendRequest

func NewDeaultTestSendRequest() *TestSendRequest

NewDeaultTestSendRequest todo

func (*TestSendRequest) Send

func (req *TestSendRequest) Send() error

Send todo

Jump to

Keyboard shortcuts

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