gomail

package module
v0.0.0-...-7c83da4 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: MIT Imports: 12 Imported by: 0

README

go-mail

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MailContent

type MailContent struct {
	From            *mail.Address
	To              []*mail.Address
	Cc              []*mail.Address
	Bcc             []*mail.Address
	ReplyTo         *mail.Address
	Subject         string
	Body            string
	BodyContentType string
	Headers         map[string]string
	Attachments     map[string]string
	ServerInfo      *SmtpServer
}

func (*MailContent) AddBcc

func (m *MailContent) AddBcc(bcc string) error

func (*MailContent) AddCc

func (m *MailContent) AddCc(cc string) error

func (*MailContent) AddHeader

func (m *MailContent) AddHeader(key, value string) error

func (*MailContent) AddTo

func (m *MailContent) AddTo(to string) error

func (*MailContent) Attach

func (m *MailContent) Attach(file string)

func (*MailContent) SendMail

func (m *MailContent) SendMail() error

func (*MailContent) SetFrom

func (m *MailContent) SetFrom(from string) error

func (*MailContent) SetHeader

func (m *MailContent) SetHeader(key, value string)

func (*MailContent) SetReplyTo

func (m *MailContent) SetReplyTo(reply string) error

type SmtpServer

type SmtpServer struct {
	SmtpHost     string
	SmtpPort     uint16
	SmtpUsername string
	SmtpPassword string
	SmtpSecret   string
	Identity     string
}

func NewSmtpServer

func NewSmtpServer(
	host string,
	port uint16,
	username, password string,
) *SmtpServer

func NewSmtpServerCRAMMD5

func NewSmtpServerCRAMMD5(
	host string,
	port uint16,
	username, secret string,
) *SmtpServer

func NewSmtpServerWithID

func NewSmtpServerWithID(
	host string,
	port uint16,
	username, password, identity string,
) *SmtpServer

func (*SmtpServer) EasySendMail

func (s *SmtpServer) EasySendMail(from, to, subject, body string) error

func (*SmtpServer) NewHTMLMessage

func (s *SmtpServer) NewHTMLMessage(subject, body string) *MailContent

func (*SmtpServer) NewMessage

func (s *SmtpServer) NewMessage(subject, body string) *MailContent

Jump to

Keyboard shortcuts

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