Documentation ¶
Index ¶
- type Attachment
- type Email
- func (e *Email) Send(to, subject, body string) error
- func (e *Email) SendTLS(to, subject, body string) error
- func (e *Email) SendTLSs(to []string, subject, body string) error
- func (e *Email) Sends(to []string, subject, body string) error
- func (e *Email) WithAppendByPath(path string) Emailer
- func (e *Email) WithAppendBytes(name string, data []byte) Emailer
- type EmailConfig
- type Emailer
- type Message
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct { Data []byte `json:"data"` //文件二进制 Name string `json:"name"` //文件名 ContentType string `json:"contentType"` //附件编码类型,比如:multipart/related;boundary=GoBoundary }
附件
type Email ¶
type Email struct {
// contains filtered or unexported fields
}
* 邮件类 基类 *
func (*Email) WithAppendByPath ¶
WithAppendByPath 添加附件
type EmailConfig ¶
type EmailConfig struct { User string `json:"user"` //邮箱账号 Password string `json:"password"` //邮箱密码 Host string `json:"host"` //邮箱服务器地址 Port string `json:"port"` //邮箱服务器端口号 }
邮件配置
type Emailer ¶
type Emailer interface { Send(to, subject, body string) error Sends(to []string, subject, body string) error SendTLS(to, subject, body string) error SendTLSs(to []string, subject, body string) error WithAppendByPath(path string) Emailer WithAppendBytes(name string, data []byte) Emailer }
* 邮件类接口 *
type Message ¶
type Message struct { From string `json:"from"` //发送邮箱 To []string `json:"to"` //接收邮箱 Cc []string `json:"cc"` //抄送邮箱 Bcc []string `json:"bcc"` //暗抄送邮箱 Subject string `json:"subject"` //邮件主题 Body string `json:"body"` //邮件内容 PlainText string `json:"plainText"` //纯文本内容 ContentType string `json:"contentType"` //邮件内容编码 Attachment []Attachment `json:"attachment"` //附件 }
邮件消息
Click to show internal directories.
Click to hide internal directories.