Documentation
¶
Index ¶
- func LoginAuth(username, password string) smtp.Auth
- func SendMail(host, port, username, password, tos, subject, body string) error
- type Attachment
- type Config
- type Message
- func (msg *Message) Attachment(attach *Attachment) *Message
- func (msg *Message) Bcc(value ...string) *Message
- func (msg *Message) Cc(value ...string) *Message
- func (msg *Message) From(value ...string) *Message
- func (msg *Message) HTML(body string) *Message
- func (msg *Message) Now() *Message
- func (msg *Message) ReplyTo(values ...string) *Message
- func (msg *Message) SetHeader(key string, value ...string) *Message
- func (msg *Message) Subject(value ...string) *Message
- func (msg *Message) Text(body string) *Message
- func (msg *Message) To(value ...string) *Message
- func (msg *Message) UnmarshalJSON(data []byte) error
- func (msg *Message) Version() *Message
- type SMTP
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Attachment ¶
type Attachment struct { Name string `json:"name" yaml:"name"` Data []byte `json:"-" yaml:"-"` Inline bool `json:"inline" yaml:"inline"` }
Attachment represents an email attachment.
func NewAttachment ¶
func NewAttachment(name string, inline bool) (*Attachment, error)
NewAttachment create new attach
type Config ¶
type Config struct { Host string `json:"host" yaml:"host"` Port string `json:"port" yaml:"port"` Username string `json:"username" yaml:"username"` Password string `json:"password" yaml:"password"` Timeout int `json:"timeout" yaml:"timeout"` }
Config config
type Message ¶
type Message struct { mail.Header Body string Attachments []*Attachment }
Message email message
func (*Message) Attachment ¶
func (msg *Message) Attachment(attach *Attachment) *Message
Attachment Attachment
func (*Message) UnmarshalJSON ¶
UnmarshalJSON UnmarshalJSON
Click to show internal directories.
Click to hide internal directories.