email

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package email : email emtp发送模块

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	// From sender name, if empty, use username
	From string
	// To target email address
	To string
	// Subject email title
	Subject string
	// Cc cc to other
	Cc string
	// Msg email body, default send as html
	Msg string
}

Data email body

type EMail

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

EMail emal send client

func NewEMail

func NewEMail(opt *SMTPOpt) (*EMail, error)

NewEMail get a new email send client

func (*EMail) Send

func (e *EMail) Send(d *Data) error

Send send email to target

type SMTPOpt

type SMTPOpt struct {
	// Username login username
	Username string
	// Passwd login password
	Passwd string
	// SMTPHost smtp server host
	SMTPHost string
	// SMTPPort smtp server port, default: 587
	SMTPPort int
}

SMTPOpt smtp config

Jump to

Keyboard shortcuts

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