Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmailClient ¶
type EmailClient struct { Host string Port int Username string Password string Message *EmailMessage }
EmailClient 发送客户端
func NewEmailClient ¶
func NewEmailClient(host, username, password string, port int, message *EmailMessage) *EmailClient
NewEmailClient 返回一个邮件客户端 host smtp地址 username 用户名 password 密码 port 端口
func (*EmailClient) SendMessage ¶
func (c *EmailClient) SendMessage() (bool, error)
SendMessage 发送邮件
type EmailMessage ¶
type EmailMessage struct { From string Nickname string To []string Cc []string Subject string ContentType string Content string Attach string }
EmailMessage 内容
func NewEmailMessage ¶
func NewEmailMessage(from, nickname, subject, contentType, content, attach string, to, cc []string) *EmailMessage
NewEmailMessage 返回消息对象 from: 发件人 subject: 标题 contentType: 内容的类型 text/plain text/html attach: 附件 to: 收件人 cc: 抄送人
Click to show internal directories.
Click to hide internal directories.