Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶ added in v0.1.1
type EmailMessage ¶
type EmailMessage struct {
// Name is the name of the sender of the email
Name string
// From is the email address of the sender of the email
From string
// To is a slice of email addresses to send the email to
To []string
// Subject is the subject of the email
Subject string
// Body can be a string (text) or (html)
Body []byte
// Attachments is a slice of file paths to attach to the email
Attachments []Attachment
// CC is a slice of email addresses to send a copy of the email to
CC []string
// BCC is a slice of email addresses to send a blind copy of the email to
BCC []string
// ReplyTo is the email address to use when replying to the email
ReplyTo string
// Template is the path to the template file to use when sending the email
Template Template
}
type GoMailer ¶
type GoMailer interface {
// SendMail sends an email using the provided message and options
SendMail(message EmailMessage) error
}
GoMailer is the interface that wraps the basic SendMail method for sending emails
func New ¶
func New(options GoMailerOption) GoMailer
New returns a new GoMailer instance with the provided options
type GoMailerOption ¶
type GoMailerOption struct {
// host to use when sending the email
Host string
// port to use when sending the email
Port int
// username to use when authenticating to the smtp server
Username string
// password to use when authenticating to the smtp server
Password string
// secure indicates whether to use a secure connection when sending the email (e.g. SSL/TLS)
Secure bool
}
Click to show internal directories.
Click to hide internal directories.