deprecated

package
v0.0.0-...-a2093d6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2022 License: LGPL-2.1 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HostQQMail = "smtp.qq.com"
	PortQQMail = "25"
)
View Source
const (
	ContentTypeText = "text/plain;charset=UTF-8"
	ContentTypeHtml = "text/html;charset=UTF-8"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Send(msg *Message) error
}

func NewClient

func NewClient(config Config) Client

type Config

type Config struct {
	Username string `json:"username"`
	Password string `json:"password"`
	// default QQMail host
	Host string `json:"host"`
	// default QQMail port
	Port string `json:"port"`
	// usually an empty string
	Identity string `json:"identity"`
}

type Message

type Message struct {
	// From sender, default "whereabouts.icu"
	From string `json:"From"`
	// To receivers, can not be nil
	To []string `json:"-"`
	// CC send a duplicate to
	CC []string `json:"-"`
	// BCC blind carbon copy
	BCC []string `json:"-"`
	// Subject email title, default "test email"
	Subject string `json:"Subject"`
	// ContentType email type:text or html
	ContentType string `json:"Content-Type"`
	// Date send time, default now
	Date string `json:"Date"`
	// Body email content, default "hello world!this is a test mail!"
	Body string `json:"-"`
}

func NewMessage

func NewMessage() *Message

func (*Message) SetBCC

func (message *Message) SetBCC(bcc ...string) *Message

func (*Message) SetBody

func (message *Message) SetBody(body string) *Message

func (*Message) SetCC

func (message *Message) SetCC(cc ...string) *Message

func (*Message) SetContent deprecated

func (message *Message) SetContent(content string) *Message

Deprecated: Use SetBody to instead.

func (*Message) SetContentType

func (message *Message) SetContentType(contentType string) *Message

func (*Message) SetDate

func (message *Message) SetDate(date string) *Message

func (*Message) SetReceiver

func (message *Message) SetReceiver(to ...string) *Message

func (*Message) SetSender

func (message *Message) SetSender(from string) *Message

func (*Message) SetSubject

func (message *Message) SetSubject(subject string) *Message

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL