emailutil

package
v0.2.31 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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

func DialTimeout(addr string, timeout time.Duration) (c *smtp.Client, err error)

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 GetName

func GetName(email string) string

GetName get name of email

func IsCompanyEmail

func IsCompanyEmail(email string) (bool, string, error)

IsCompanyEmail checks if email is a company email

func IsKnowHost

func IsKnowHost(host string) bool

func LookMX

func LookMX(domain string) ([]string, error)

func ValidateFormat

func ValidateFormat(email string) error

func ValidateHost

func ValidateHost(email string) (err error)

func VerifyEmailFormat

func VerifyEmailFormat(email string) (bool, string)

VerifyEmailFormat

Types

type Configuration added in v0.2.0

type Configuration struct {
	Host     string
	Port     string
	Username string
	Password string
	From     string
}

Configuration for mail

type GoMail added in v0.2.0

type GoMail struct {
	From    string
	To      []string
	Cc      []string
	Bcc     []string
	Subject string
	Content string
}

GoMail config

func (*GoMail) Send added in v0.2.0

func (gm *GoMail) Send() error

Send email

func (*GoMail) String added in v0.2.0

func (gm *GoMail) String() string

http://tools.ietf.org/html/rfc822 http://tools.ietf.org/html/rfc2821

Jump to

Keyboard shortcuts

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