Documentation
¶
Index ¶
- Variables
- func DialTimeout(addr string, timeout time.Duration) (c *smtp.Client, err error)
- func GetName(email string) string
- func IsCompanyEmail(email string) (bool, string, error)
- func IsKnowHost(host string) bool
- func LookMX(domain string) ([]string, error)
- func ValidateFormat(email string) error
- func ValidateHost(email string) (err error)
- func VerifyEmailFormat(email string) (bool, string)
- type Configuration
- type Email
- type File
- type GoMail
- type Message
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBadFormat = errors.New("invalid format") ErrUnresolvableHost = errors.New("unresolvable host") )
View Source
var Config = Configuration{
Host: "smtp.qq.com",
Port: "25",
Username: "",
Password: "",
From: "",
}
Config default configuration
Functions ¶
func DialTimeout ¶
DialTimeout returns a new Client connected to an SMTP server at addr. The addr must include a port, as in "mail.example.com:smtp".
func IsCompanyEmail ¶
IsCompanyEmail checks if email is a company email
func IsKnowHost ¶
func ValidateFormat ¶
func ValidateHost ¶
Types ¶
type Configuration ¶
Configuration for mail
type Email ¶
type GoMail ¶
type GoMail struct {
From string
To []string
Cc []string
Bcc []string
Subject string
Content string
}
GoMail config
type Message ¶
type Message struct {
ID string `json:"id"`
From string `json:"from"`
To string `json:"to"`
CC string `json:"cc"`
Subject string `json:"subject"`
BodyText string `json:"body_text"`
BodyHTML string `json:"body_html"`
Inlines []*File `json:"inlines"`
Attachments []*File `json:"attachments"`
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.