mailer

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GroupAPI is the group API scope use in this package
	GroupAPI = "sxlibs.k8s.startx.fr"
	// GroupName is the group name use in this package
	GroupName = "mailer"
)
View Source
const (
	// GroupName is the group name use in this package
	GroupNameMail = "mailer.mail"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Mailer

type Mailer struct {
	SmtpHost     string
	SmtpPort     string
	SmtpUsername string
	SmtpPassword string
	// contains filtered or unexported fields
}

Mailer is a wrapper around api.Config

func NewMailer

func NewMailer(smtpHost string, smtpPort string, smtpUsername string, smtpPassword string) *Mailer

Initialize a mailer object ex:

mailer := kc.NewMailer()

func (*Mailer) Send

func (mailer *Mailer) Send(mail *MailerMail, insecure bool) error

Send an email

type MailerMail

type MailerMail struct {
	From        string
	To          string
	Subject     string
	Body        string
	Attachments []MailerMailAttachment
	// contains filtered or unexported fields
}

Mailer is a wrapper around api.Config

func NewMailerMail

func NewMailerMail(from string, to string, subject string, message string) *MailerMail

Initialize a mailer object ex:

mailer := kc.NewMailer()

func (*MailerMail) AddAttachment

func (mail *MailerMail) AddAttachment(filename string, filecontent []byte) *MailerMail

Set the body of the mail

func (*MailerMail) Send

func (mail *MailerMail) Send(mailer *Mailer, insecure bool) error

Set the body of the mail

func (*MailerMail) SetBody

func (mail *MailerMail) SetBody(message string) *MailerMail

Set the body of the mail

func (*MailerMail) SetFrom

func (mail *MailerMail) SetFrom(from string) *MailerMail

Set the from of the mail

func (*MailerMail) SetSubject

func (mail *MailerMail) SetSubject(subject string) *MailerMail

Set the subject of the mail

func (*MailerMail) SetTo

func (mail *MailerMail) SetTo(from string) *MailerMail

Set the to of the mail

func (*MailerMail) SetToSingle

func (mail *MailerMail) SetToSingle(fromString string) *MailerMail

Set the to of the mail

type MailerMailAttachment

type MailerMailAttachment struct {
	Filename    string
	Content     []byte
	ContentType string
}

Jump to

Keyboard shortcuts

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