email

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: AGPL-3.0 Imports: 22 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 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