smtp

package
v0.0.52 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrHostIsEmpty      = "host is empty"
	ErrPortIsNotSet     = "port is not set"
	ErrUsernameIsEmpty  = "username is empty"
	ErrUserAgentIsEmpty = "user agent is empty"
)
View Source
const (
	RpcErrorCode_MailerError       = 1
	RpcErrorCode_RecipientIsNotSet = 2
	RpcErrorCode_SubjectIsNotSet   = 3
	RpcErrorCode_MessageIsNotSet   = 4
)

Codes.

View Source
const (
	RpcErrorMsgF_MailerError      = "mailer error: %s"
	RpcErrorMsg_RecipientIsNotSet = "recipient is not set"
	RpcErrorMsg_SubjectIsNotSet   = "subject is not set"
	RpcErrorMsg_MessageIsNotSet   = "message is not set"
)

Messages.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mailer

type Mailer struct {
	// contains filtered or unexported fields
}

Mailer is an e-mail sender. It sends e-mail messages using the SMTP protocol.

func NewMailer

func NewMailer(
	host string,
	port uint16,
	username string,
	pwd string,
	userAgent string,
) (m *Mailer, err error)

func (*Mailer) SendMail

func (m *Mailer) SendMail(
	recipients []string,
	subject string,
	message string,
) (err error)

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(s cm.ISettings) (srv *Server, err error)

func (*Server) GetListenDsn

func (srv *Server) GetListenDsn() (dsn string)

func (*Server) GetMustStopAB added in v0.0.40

func (srv *Server) GetMustStopAB() *atomic.Bool

func (*Server) GetStopChannel

func (srv *Server) GetStopChannel() *chan bool

func (*Server) GetSubRoutinesWG added in v0.0.40

func (srv *Server) GetSubRoutinesWG() *sync.WaitGroup

func (*Server) Ping

func (srv *Server) Ping(_ *json.RawMessage, _ *jrm1.ResponseMetaData) (result any, re *jrm1.RpcError)

func (*Server) ReportStart

func (srv *Server) ReportStart()

func (*Server) SendMessage

func (srv *Server) SendMessage(params *json.RawMessage, _ *jrm1.ResponseMetaData) (result any, re *jrm1.RpcError)

func (*Server) ShowDiagnosticData

func (srv *Server) ShowDiagnosticData(params *json.RawMessage, _ *jrm1.ResponseMetaData) (result any, re *jrm1.RpcError)

func (*Server) Start

func (srv *Server) Start() (err error)

func (*Server) Stop

func (srv *Server) Stop() (err error)

func (*Server) UseConstructor

func (srv *Server) UseConstructor(stn cm.ISettings) (cm.IServer, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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