email

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GMAIL_SMTP_HOST = "smtp.gmail.com"
	GMAIL_SMTP_PORT = "587"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SMTPSender string `mapstructure:"GMAIL_NAME"`
	SMTPUser   string `mapstructure:"GMAIL_USER"`
	SMTPPass   string `mapstructure:"GMAIL_PASS"`
}

type GmailSender

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

GmailSender is a struct that represents a Gmail email sender.

func (*GmailSender) SendMail

func (gmail *GmailSender) SendMail(mail Mail) error

SendMail sends an email using the GmailSender.

type Mail

type Mail struct {
	To      []string // List of recipients' email addresses.
	Cc      []string // List of carbon copy recipients' email addresses.
	Bcc     []string // List of blind carbon copy recipients' email addresses.
	Subject string   // Email subject.
	Body    string   // Email body.
	Files   []string // List of file paths to attach to the email.
}

Mail represents an email message.

type MailSender

type MailSender interface {
	SendMail(mail Mail) error
}

MailSender is an interface for sending emails.

func NewGmailSender

func NewGmailSender(config Config) (MailSender, error)

NewGmailSender creates a new GmailSender instance with the provided GmailSMTP configuration.

Jump to

Keyboard shortcuts

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