email

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DialTLS

func DialTLS(addr string, insecureSkipVerify bool) (*smtp.Client, error)

func New

func New(host, port, user, password, displayUser, isSSLStr, insecureSkipVerify string, bundle *bundle.Bundle) subscriber.Subscriber

func SendMailUsingTLS

func SendMailUsingTLS(addr string, auth smtp.Auth, from string, tos []string, insecureSkipVerify bool, msg []byte) (err error)

Types

type Attachment

type Attachment struct {
	Filename string `json:"filename"`
	Content  string `json:"content"`
	Inline   bool   `json:"inline"`
	Encoding string `json:"encoding"`
}

type MailData

type MailData struct {
	Template    string            `json:"template"`
	Params      map[string]string `json:"params"`
	Type        string            `json:"type"` // 默认不做二次渲染当做html, 值为markdown时:使用模式渲染html
	Attachments []*Attachment     `json:"attachments"`
	OrgID       int64             `json:"orgID"`
}

type MailSubscriber

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

func (*MailSubscriber) IsSSL

func (d *MailSubscriber) IsSSL() bool

func (*MailSubscriber) Name

func (d *MailSubscriber) Name() string

func (*MailSubscriber) Publish

func (d *MailSubscriber) Publish(dest string, content string, time int64, msg *types.Message) []error

func (*MailSubscriber) Status

func (d *MailSubscriber) Status() interface{}

type MailSubscriberInfo added in v1.5.0

type MailSubscriberInfo struct {
	Host               string
	Port               string
	User               string
	Password           string
	DisplayUser        string
	IsSSL              bool
	InsecureSkipVerify bool
}

func NewMailSubscriberInfo added in v1.5.0

func NewMailSubscriberInfo(host, port, user, password, displayUser, isSSLStr, insecureSkipVerify string) *MailSubscriberInfo

type Message

type Message struct {
	From            string
	FromDisplayName string
	To              []string
	Cc              []string
	Subject         string
	Body            string
	BodyContentType string
	Attachments     []*Attachment
}

func NewMessage

func NewMessage(subject string, body string, bodyContentType string) *Message

func (*Message) Attach

func (m *Message) Attach(attachment *Attachment)

func (*Message) Bytes

func (m *Message) Bytes() []byte

type Option

type Option func(*MailSubscriber)

Jump to

Keyboard shortcuts

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