mailer

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mailer

type Mailer struct {
	MailFrom   *mail.Address
	SendMethod sendMethod
}

func (*Mailer) SendMail

func (r *Mailer) SendMail(to *mail.Address, subject, content string) (err error)

SendMail takes a content writen in Markdown to send it to the given user. It uses Markdown to create a HTML version of the message and leave the Markdown format in the text version. To perform sending, it relies on the SendMethod global variable.

type SMTPMailer

type SMTPMailer struct {
	Dialer gomail.Dialer
}

SMTPSendmail uses a SMTP server to send message

func NewSMTPMailer

func NewSMTPMailer(host string, port uint, username, password string) *SMTPMailer

func (*SMTPMailer) PrepareAndSend

func (t *SMTPMailer) PrepareAndSend(m ...*gomail.Message) (err error)

Send sends an e-mail to the given recipients using configured SMTP host.

func (*SMTPMailer) WithTLSNoVerify

func (t *SMTPMailer) WithTLSNoVerify()

type SystemSendmail

type SystemSendmail struct{}

SystemSendmail uses the sendmail command to send message

func (*SystemSendmail) PrepareAndSend

func (t *SystemSendmail) PrepareAndSend(m ...*gomail.Message) (err error)

Send sends an e-mail to the given recipients using the sendmail command.

func (*SystemSendmail) Send

func (t *SystemSendmail) Send(from string, to []string, msg io.WriterTo) error

Source Files

  • mailer.go
  • sendmail.go
  • smtp.go
  • templates.go

Jump to

Keyboard shortcuts

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