Documentation ¶
Index ¶
- type Attachment
- type Header
- type Message
- func (m *Message) AddBCC(address *mail.Address) []*mail.Address
- func (m *Message) AddCC(address *mail.Address) []*mail.Address
- func (m *Message) AddHeader(key string, value string) Header
- func (m *Message) AddTO(address *mail.Address) []*mail.Address
- func (m *Message) Attach(file string) error
- func (m *Message) AttachBuffer(filename string, buf []byte, inline bool, cid string)
- func (m *Message) Inline(file string, cid string) error
- func (m *Message) Send() error
- func (m *Message) SendWithMta(mta *db.MTA) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct { Filename string // filename Data []byte // attachment data Inline bool // is inline ContentId string // content id }
Attachment 邮件附件
type Message ¶
type Message struct { To []*mail.Address Cc []*mail.Address Bcc []*mail.Address ReplyTo string Subject string Body string BodyType string Headers []Header Attachments map[string]*Attachment // contains filtered or unexported fields }
Message SMTP 消息
func HTMLMessage ¶
HTMLMessage returns a new Message that can compose an HTML email with attachments
func TextMessage ¶
TextMessage returns a new Message that can compose an email with attachments
func (*Message) AttachBuffer ¶
AttachBuffer 添加一个二进制的附件
Click to show internal directories.
Click to hide internal directories.