gf: github.com/gogf/gf/g/net/gsmtp Index | Files

package gsmtp

import "github.com/gogf/gf/g/net/gsmtp"

Package gsmtp provides a SMTP client to access remote mail server.

eg: s := smtp.New("smtp.exmail.qq.com:25", "notify@a.com", "password") glog.Println(s.SendMail("notify@a.com", "ulric@b.com;rain@c.com", "subject", "body, <font color=red>red</font>"))

Index

Package Files

gsmtp.go

type SMTP Uses

type SMTP struct {
    Address  string
    Username string
    Password string
}

func New Uses

func New(address, username, password string) *SMTP

New creates and returns a new SMTP object.

func (*SMTP) SendMail Uses

func (s *SMTP) SendMail(from, tos, subject, body string, contentType ...string) error

SendMail connects to the server at addr, switches to TLS if possible, authenticates with the optional mechanism a if possible, and then sends an email from address from, to addresses to, with message msg.

Package gsmtp imports 4 packages (graph). Updated 2019-06-24. Refresh now. Tools for package owners.