import "github.com/gobuffalo/buffalo/mail"
attachment.go body.go mail.go message.go sender.go smtp_sender.go
Attachment are files added into a email message
Body represents one of the bodies in the Message could be main or alternative
type Message struct { Context context.Context From string To []string CC []string Bcc []string Subject string Headers map[string]string Data render.Data Bodies []Body Attachments []Attachment // contains filtered or unexported fields }
Message represents an Email message
New builds a new message with the current buffalo.Context
NewFromData builds a new message with raw template data given
NewMessage builds a new message.
AddAttachment adds the attachment to the list of attachments the Message has.
AddBodies Allows to add multiple bodies to the message, it returns errors that could happen in the rendering.
AddBody the message by receiving a renderer and rendering data, first message will be used as the main message Body rest of them will be passed as alternative bodies on the email message
AddEmbedded adds the attachment to the list of attachments the Message has and uses inline instead of attachement property.
SetHeader sets the heder field and value for the message
SMTPSender allows to send Emails by connecting to a SMTP server.
NewSMTPSender builds a SMTP mail based in passed config.
func (sm SMTPSender) Send(message Message) error
Send a message using SMTP configuration or returns an error if something goes wrong.
Sender interface for any upcoming mailers.
Path | Synopsis |
---|---|
internal/mail | Package gomail provides a simple interface to compose emails and to mail them efficiently. |
Package mail imports 9 packages (graph) and is imported by 5 packages. Updated 2019-11-01. Refresh now. Tools for package owners.