FlyWhisper

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ImgSuffix = []string{".bmp", ".jpg", ".jpeg", ".png", ".tiff", ".gif", ".pcx", ".tga", ".exif", ".fpx", ".svg", ".psd", ".cdr", ".pcd", ".dxf", ".ufo", ".eps", ".ai", ".raw", ".wmf"}
)

img suffix

Functions

This section is empty.

Types

type Message

type Message struct {
	// contains filtered or unexported fields
}

定义发送的内容

func NewMessage

func NewMessage(subject string, to []string) *Message

func (*Message) AddAttach

func (m *Message) AddAttach(filename string) error

添加attachment

func (*Message) AddHtml

func (m *Message) AddHtml(html string)

添加html

func (*Message) AddInline

func (m *Message) AddInline(filename string) error

添加inlineImg

func (*Message) AddRcpt

func (m *Message) AddRcpt(users []string)

添加接收者

func (*Message) AddText

func (m *Message) AddText(text string)

添加text

func (*Message) RemoveAttach

func (m *Message) RemoveAttach()

删除inlineImg

func (*Message) RemoveHtml

func (m *Message) RemoveHtml()

删除text

func (*Message) RemoveInline

func (m *Message) RemoveInline()

删除inlineImg

func (*Message) RemoveRcpt

func (m *Message) RemoveRcpt(user string) string

删除接收者 删除成功返回删除的名称 不存在返回""

func (*Message) RemoveText

func (m *Message) RemoveText()

删除text

func (*Message) SetAttach

func (m *Message) SetAttach(filename string) error

设置inlineImg

func (*Message) SetHtml

func (m *Message) SetHtml(html string)

设置text

func (*Message) SetInline

func (m *Message) SetInline(filename string) error

设置inlineImg

func (*Message) SetRcpt

func (m *Message) SetRcpt(users []string)

设置接收者

func (*Message) SetText

func (m *Message) SetText(text string)

设置text

type SMTPSender

type SMTPSender struct {
	Username string
	Password string
	Host     string
	Port     string
	Header   textproto.MIMEHeader
	Subject  string
	From     string
	Text     string
	Html     string
}

发送者

func NewMailer

func NewMailer(username string, password string, host string, port string, from string) *SMTPSender

func (*SMTPSender) Send

func (s *SMTPSender) Send(message *Message) error

Jump to

Keyboard shortcuts

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