Documentation ¶
Index ¶
- Constants
- func ConvertToUTF8(b []byte, charset string) ([]byte, error)
- func Decode(encoding byte, text string) ([]byte, error)
- func ImapLogin(host string, port int, username string, password string, ssl bool) (*client.Client, error)
- func IsGBK(data []byte) bool
- func IsUTF8(data []byte) bool
- func IsUTF8String(s string) bool
- func MailDecodeHeader(s string) (string, error)
- func QDecode(s string) ([]byte, error)
- func SMTPLogin(host string, port int, username string, password string, ssl bool) (gomail.SendCloser, error)
- func SendMail(c gomail.SendCloser, sendConfig *SendConfig) error
- type CommonError
- type MailMessage
- type PostFilter
- type PreFilter
- type SendConfig
- type WordDecoder
Constants ¶
View Source
const UID_NAME = "X-Mirror-Uid"
Variables ¶
This section is empty.
Functions ¶
func ConvertToUTF8 ¶
Convert gbk等转为utf-8 bytes
func IsUTF8String ¶
func MailDecodeHeader ¶
MailDecodeHeader 自行处理strHeader,类似=?GB2312?B?1tDOxLi9vP6y4srU?=
func SendMail ¶
func SendMail(c gomail.SendCloser, sendConfig *SendConfig) error
Types ¶
type CommonError ¶
type CommonError struct {
Cause string
}
func (CommonError) Error ¶
func (e CommonError) Error() string
type MailMessage ¶
type MailMessage struct { //Uid int Subject string From string To string Uid string Body string Attachments []string //filenames }
func RecvSearch ¶
func RecvSearch(c *client.Client, bf *PreFilter, af *PostFilter) ([]MailMessage, error)
type PostFilter ¶
type PostFilter struct { Subject string From string To string Uid string SentSince string //日期格式字符串 "2006-01-02" Body []string Attachments []string //filenames }
PostFilter qq等邮箱使用中文过滤时会报错:imap: cannot send literal: no continuation request received 先用临时解决办法吧,PreFilter过滤条件不要输入中文,获取结果后再次过滤
type SendConfig ¶
type WordDecoder ¶
type WordDecoder struct { // CharsetReader, if non-nil, defines a function to generate // charset-conversion readers, converting from the provided // charset into UTF-8. // Charsets are always lower-case. utf-8, iso-8859-1 and us-ascii charsets // are handled by default. // One of the CharsetReader's result values must be non-nil. CharsetReader func(charset string, input io.Reader) (io.Reader, error) }
A WordDecoder decodes MIME headers containing RFC 2047 encoded-words.
func (*WordDecoder) DecodeHeader ¶
func (d *WordDecoder) DecodeHeader(header string) (string, error)
DecodeHeader decodes all encoded-words of the given string. It returns an error if and only if CharsetReader of d returns an error.
Click to show internal directories.
Click to hide internal directories.