Documentation ¶
Index ¶
- Constants
- func NewRFC822(w io.Writer) io.Writer
- func Send(ctx context.Context, rcpts []string, body Body, serverOpts ServerOption) (err error)
- type Address
- type AddressList
- func (l *AddressList) Add(address ...string) (err error)
- func (l *AddressList) AddAddress(addrs ...*Address)
- func (l *AddressList) AddOne(address string, name ...string)
- func (l *AddressList) At(index int) (find *Address)
- func (l *AddressList) Purge()
- func (l *AddressList) Rcpts() []string
- func (l *AddressList) String() string
- func (l *AddressList) Text() []string
- type Attachment
- type AttachmentList
- type Body
- type Header
- func (hdr *Header) Add(k, v string)
- func (hdr *Header) Boundary() string
- func (hdr *Header) Del(k string)
- func (hdr *Header) Each(walkFn func(k, v string))
- func (hdr *Header) Get(k string) (v string)
- func (hdr *Header) GetContentTransferEncoding() string
- func (hdr *Header) HeaderBytes() []byte
- func (hdr *Header) Set(k, v string)
- func (hdr *Header) SetContentDisposition(contentDisposition string, params ...string)
- func (hdr *Header) SetContentTransferEncoding(cte string)
- func (hdr *Header) SetContentType(mimetype string, params ...string)
- func (hdr *Header) SetMultipartType(partType string)
- func (hdr *Header) SetText(k, v string)
- func (hdr *Header) SetTextType(textType string)
- func (hdr *Header) WriteTo(w io.Writer) (int64, error)
- type Message
- type ServerOption
Constants ¶
View Source
const ( HeaderContentTransferEncoding = "Content-Transfer-Encoding" HeaderContentType = "Content-Type" HeaderContentDisposition = "Content-Disposition" CTE_Q = "quoted-printable" CTE_B = "base64" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Address ¶
type AddressList ¶
type AddressList []*Address
func ParseAddressList ¶
func ParseAddressList(addressList ...string) (out AddressList, err error)
func (*AddressList) Add ¶
func (l *AddressList) Add(address ...string) (err error)
func (*AddressList) AddAddress ¶ added in v0.0.2
func (l *AddressList) AddAddress(addrs ...*Address)
func (*AddressList) AddOne ¶ added in v0.0.2
func (l *AddressList) AddOne(address string, name ...string)
func (*AddressList) At ¶
func (l *AddressList) At(index int) (find *Address)
func (*AddressList) Purge ¶
func (l *AddressList) Purge()
func (*AddressList) Rcpts ¶
func (l *AddressList) Rcpts() []string
func (*AddressList) String ¶
func (l *AddressList) String() string
func (*AddressList) Text ¶
func (l *AddressList) Text() []string
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
Header 媒体头
func (*Header) GetContentTransferEncoding ¶
GetContentTransferEncoding 获取 ContentTransferEncoding
func (*Header) SetContentDisposition ¶
SetContentDisposition 设置内容的编码处理方式
func (*Header) SetContentTransferEncoding ¶
SetContentTransferEncoding 设置内容的传输编码方式,name: "quoted-printable", "base64"
func (*Header) SetContentType ¶
SetContentType 设置ContentType
func (*Header) SetMultipartType ¶
SetMultipartType 设置为多媒体类型
func (*Header) SetTextType ¶
SetTextType 设置ContentType为文本类型
type Message ¶ added in v0.0.2
type Message struct { To AddressList Cc AddressList Bcc AddressList Subject string Content string Attach AttachmentList From Address ReplyTo Address ReturnPath Address Headers Header }
Message 邮件消息模型
type ServerOption ¶
type ServerOption struct { Name string `json:"name,omitempty"` From string `json:"from,omitempty"` User string `json:"user,omitempty"` Pass string `json:"pass,omitempty"` Host string `json:"host,omitempty"` Port string `json:"port,omitempty"` }
func (ServerOption) String ¶
func (server ServerOption) String() string
func (ServerOption) Valid ¶
func (server ServerOption) Valid() error
Click to show internal directories.
Click to hide internal directories.