smtpmail

package
v0.0.0-...-a532a67 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: LGPL-3.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EscepeSubject

func EscepeSubject(s string) string

EscepeSubject remove incorrect characters

func FormatMail

func FormatMail(mail *goatmail.Mail, lc *jobsync.Lifecycle) (io.Reader, error)

FormatMail prepare SMTP message

func NewBase64Encoder

func NewBase64Encoder(base io.Reader) io.Reader

NewBase64Encoder create new Base64Encoder instance from reader

Types

type Base64Encoder

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

Base64Encoder is a bease64 encoder reader

func (*Base64Encoder) Read

func (reader *Base64Encoder) Read(dst []byte) (n int, err error)

type Config

type Config struct {
	// SMTPAddr is SMTP server address
	SMTPAddr string `json:"smtpAddr"`
	// AuthUsername is username for SMTP server
	AuthUsername string `json:"authUsername"`
	// AuthPassword is password for SMTP server
	AuthPassword string `json:"authPassword"`
	// AuthIdentity is identity for SMTP server
	AuthIdentity string `json:"authIdentity"`
}

Config provide smtp mail configuration

type MailSender

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

MailSender provide dial send stream api

func NewMailSender

func NewMailSender(config Config) *MailSender

NewMailSender create new MailSender isntance

func (*MailSender) Send

func (ms *MailSender) Send(mail *goatmail.Mail, lc *jobsync.Lifecycle) error

Send transmit email to server. Use Lifecycle for communication streams.

Jump to

Keyboard shortcuts

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