gomail_mailer

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHost        = "0.0.0.0"
	DefaultPort        = 25
	DefaultUsername    = ""
	DefaultAppPassword = ""
	DefaultTLS         = false

	DefaultSubject = "From HRMS"
	DefaultBody    = "This is an email from HRMS."
	DefaultFrom    = "hrms@hrms.com"
	DefaultTo      = "hrms@hrms.com"
)

Variables

This section is empty.

Functions

func InitiateModule

func InitiateModule(scope string) fx.Option

Types

type Config

type Config struct {
	Host        string
	Port        int
	Username    string
	AppPassword string //! Important: Use app password, not the account password.
	TLS         bool
}

type Mailer

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

func (*Mailer) NewMessage

func (m *Mailer) NewMessage() *gomail.Message

func (*Mailer) Send

func (m *Mailer) Send(msg *gomail.Message) error

func (*Mailer) SendTestMail

func (m *Mailer) SendTestMail(to, subject, body string) error

func (*Mailer) TestSMTPConnection

func (m *Mailer) TestSMTPConnection() error

type Params

type Params struct {
	fx.In

	Lifecycle fx.Lifecycle
	Logger    *zap.Logger
}

Jump to

Keyboard shortcuts

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