kmgEmail

package
v0.0.0-...-05317bf Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEmailFormat

func IsEmailFormat(email string) bool

func SmtpSendEmail

func SmtpSendEmail(req *SmtpRequest) (err error)

Types

type SmtpRequest

type SmtpRequest struct {
	SmtpHost     string
	SmtpPort     int
	SmtpUsername string //also as stmp username
	SmtpPassword string
	From         string
	To           []string
	Subject      string
	Message      string

	Socks4aProxyAddr string
}

func NewSmtpRequestFromGmail

func NewSmtpRequestFromGmail(gmail string, password string) *SmtpRequest

从gmail发送邮件

req := kmgEmail.NewSmtpRequestFromGmail("xxxx@gmail.com", "xxxx")
req.To = []string{"xxxx@gmail.com"}
req.Subject = "测试邮件标题2"
req.Message = "<p>测试邮件内容2</p>"
req.Socks4aProxyAddr = "127.0.0.1:20000"
return kmgEmail.SmtpSendEmail(req)

Jump to

Keyboard shortcuts

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