Documentation ¶
Index ¶
- Constants
- Variables
- func GetHost(email string) (string, error)
- func GetLoginName(email string) (string, error)
- func MakeBody() (string, error)
- func MimeConvHtml()
- func Send(e Envelope, c SendContent, password string, p *Provider) error
- func TestAccount(addr, pwd string, p *Provider) error
- func Validate(email string) error
- type Account
- type AddrEdit
- type Address
- type Attachment
- type BodyType
- type Envelope
- type Filter
- type IndexType
- type MQ
- type Mail
- type Msg
- type Provider
- type Receiver
- func (s *Receiver) Close() error
- func (s *Receiver) GetBoxInfo(box string) (total, unread int, err error)
- func (s *Receiver) GetEnvelopes(box string, filter *Filter) ([]Envelope, error)
- func (s *Receiver) GetMails(box string, uid []int) ([]Mail, error)
- func (s *Receiver) ShowAllBoxes() ([]string, error)
- type RecvContent
- type SendContent
- type Template
Constants ¶
View Source
const ( INBOX = "INBOX" StartIndex = 1 // First index(Uid or SeqNum) is 1, NOT 0 )
Variables ¶
View Source
var ( InProviders = []Provider{ { SMTPAddress: "smtp.gmail.com:465", SMTPIsSSL: true, POP3Address: "pop.gmail.com:995", POP3IsSSL: true, IMAPAddress: "imap.gmail.com:993", IMAPIsSSL: true, EmailDomain: "gmail.com", }, { SMTPAddress: "smtp.qq.com:465", SMTPIsSSL: true, POP3Address: "pop.qq.com:995", POP3IsSSL: true, IMAPAddress: "imap.qq.com:993", IMAPIsSSL: true, EmailDomain: "qq.com", }, { SMTPAddress: "smtp.mail.yahoo.com:465", SMTPIsSSL: true, POP3Address: "pop.mail.yahoo.com:110", POP3IsSSL: true, IMAPAddress: "imap.mail.yahoo.com:993", IMAPIsSSL: true, EmailDomain: "yahoo.com", }, { SMTPAddress: "smtp.aliyun.com:25", SMTPIsSSL: false, POP3Address: "pop3.aliyun.com:110", POP3IsSSL: false, IMAPAddress: "imap.aliyun.com", IMAPIsSSL: false, EmailDomain: "aliyun.com", }, { SMTPAddress: "smtp.163.com:465", SMTPIsSSL: true, POP3Address: "pop.163.com:995", POP3IsSSL: true, IMAPAddress: "imap.163.com:993", IMAPIsSSL: true, EmailDomain: "163.com", }, { SMTPAddress: "smtp.126.com:465", SMTPIsSSL: true, POP3Address: "pop.126.com:995", POP3IsSSL: true, IMAPAddress: "imap.126.com:993", IMAPIsSSL: true, EmailDomain: "126.com", }, } )
Functions ¶
func GetLoginName ¶
func MimeConvHtml ¶
func MimeConvHtml()
Types ¶
type Address ¶
type Address struct {
// contains filtered or unexported fields
}
func NewAddress ¶
func (*Address) EmailReplaceLoginNameTail ¶
type Attachment ¶
type Envelope ¶
type Filter ¶
type Filter struct { AfterThisTime *time.Time BeforeThisTime *time.Time SubjectContains *string SenderContains *string IndexType IndexType IndexStart *int IndexStop *int }
func (*Filter) CheckEnvelope ¶
Check whether input envelope fits current Filter
type Mail ¶
type Mail struct { Env Envelope Content RecvContent }
type Provider ¶
type Provider struct { SMTPAddress string SMTPIsSSL bool POP3Address string POP3IsSSL bool IMAPAddress string IMAPIsSSL bool EmailDomain string // Used to parse provider from email address }
Mail service provider
func TryParseProvider ¶
func (*Provider) GetReceiveServer ¶
Get receive server: IMAP / POP3
func (*Provider) GetSendServer ¶
Get send server: SMTP / IMAP
type Receiver ¶
type Receiver struct {
// contains filtered or unexported fields
}
func (*Receiver) GetBoxInfo ¶
func (*Receiver) GetEnvelopes ¶
Notice: 如何尽可能少的拉取Envelope: 把起止Uid或者SeqNum作为查询条件放进去
func (*Receiver) ShowAllBoxes ¶
type RecvContent ¶
type RecvContent struct { BodyType BodyType BodyString string Attachments []Attachment }
type SendContent ¶
Click to show internal directories.
Click to hide internal directories.