Documentation ¶
Index ¶
- Variables
- func IsValidAddress(addr string) bool
- type Message
- func (m *Message) AddAttachment(filename string, attachment []byte)
- func (m *Message) AddAttachmentFromFile(filename string) error
- func (m *Message) AddBCC(emailAddr string)
- func (m *Message) AddCC(emailAddr string)
- func (m *Message) AddTo(emailAddr string)
- func (m *Message) Body() []byte
- func (m *Message) From() string
- func (m *Message) Name() string
- func (m *Message) Recipients() []string
- func (m *Message) SetName(name string)
- type SMTP
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidScheme = errors.New("invalid scheme") ErrNoRecipients = errors.New("no recipients specified") )
Define errors
Functions ¶
func IsValidAddress ¶
IsValidAddress validates the input email address, returning false if the address cannot be parsed by mail.ParseAddress.
Types ¶
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message defines an email message, headers, and attachments.
func NewHTMLMessage ¶
NewHTMLMessage creates a new text/html email.
func NewMessage ¶
NewMessage creates a new text/plain email.
func NewMessageType ¶
NewMessageType creates a new email with the specified content-type.
func (*Message) AddAttachment ¶
AddAttachment adds the provided attachment to the message.
func (*Message) AddAttachmentFromFile ¶
AddAttachmentFromFile adds an attachment specified by filename to the message.
func (*Message) Recipients ¶
Recipients returns an array of all the recipients, which includes To, CC, and BCC
Click to show internal directories.
Click to hide internal directories.