本文整理汇总了Golang中github.com/bradfitz/go-smtpd/smtpd.MailAddress类的典型用法代码示例。如果您正苦于以下问题:Golang MailAddress类的具体用法?Golang MailAddress怎么用?Golang MailAddress使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MailAddress类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: AddRecipient
func (e *env) AddRecipient(rcpt smtpd.MailAddress) error {
if strings.HasPrefix(rcpt.Email(), "[email protected]") {
return errors.New("we don't send email to [email protected]")
}
e.msg.To[localcount] = rcpt.Email()
localcount++
return e.BasicEnvelope.AddRecipient(rcpt)
}
示例2: AddRecipient
func (e *env) AddRecipient(rcpt smtpd.MailAddress) error {
if strings.HasPrefix(rcpt.Email(), "[email protected]") {
return errors.New("we don't send email to [email protected]")
}
fmt.Println("Typeof to list", reflect.TypeOf(e.msg.To))
e.msg.To = append(e.msg.To, rcpt.Email())
fmt.Println(e.msg.To)
// e.msg.To[localcount] = rcpt.Email()
// localcount++
return e.BasicEnvelope.AddRecipient(rcpt)
}
示例3: AddRecipient
func (e *fakeEnvelope) AddRecipient(rcpt smtpd.MailAddress) error {
e.m.To = append(e.m.To, rcpt.Email())
return nil
}
示例4: onNewMail
func onNewMail(c smtpd.Connection, from smtpd.MailAddress) (smtpd.Envelope, error) {
log.Printf("New mail received from %q", from)
myMessage.From = from.Email()
return &Envelope{new(smtpd.BasicEnvelope), myMessage}, nil
}
示例5: onNewMail
func onNewMail(c smtpd.Connection, from smtpd.MailAddress) (smtpd.Envelope, error) {
myMessage.From = from.Email()
return &env{new(smtpd.BasicEnvelope), myMessage}, nil
}
示例6: onNewMail
func (s *server) onNewMail(conn smtpd.Connection, from smtpd.MailAddress) (smtpd.Envelope, error) {
log.Printf("smtp: new mail from %s", from.Email())
return &env{s: s, from: webfist.NewEmailAddr(from.Email())}, nil
}
示例7: AddRecipient
func (e *Envelope) AddRecipient(rcpt smtpd.MailAddress) error {
e.msg.To = append(e.msg.To, rcpt.Email())
return e.BasicEnvelope.AddRecipient(rcpt)
}
示例8: AddRecipient
func (e *envelope) AddRecipient(rcpt smtpd.MailAddress) error {
if strings.HasPrefix(rcpt.Email(), "[email protected]") {
return errors.New("we don't send email to [email protected]")
}
return e.BasicEnvelope.AddRecipient(rcpt)
}