service

package
v0.0.0-...-ecd1ea2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	TextHTML  = "text/html"
	TextPlain = "text/plain"
)

Variables

View Source
var (
	SMTPConfigPath string
)

Functions

func FindSMTPJSONFile

func FindSMTPJSONFile() (string, error)

func SendWithSSL

func SendWithSSL(smtpAddress string, username, password string, message *Message) error

SendWithoutSSL send mail

func SendWithoutSSL

func SendWithoutSSL(smtpAddress string, username, password string, message *Message) error

SendWithoutSSL send mail

Types

type Contact

type Contact struct {
	Name    string
	Address string
}

Contact contact

type File

type File struct {
	Path      string
	AliasName string
}

File file

type Message

type Message struct {
	From        Contact
	To          []Contact
	Cc          []Contact
	Bcc         []Contact
	Subject     string
	Body        string
	ContentType string
	Attach      []File
}

Message msg

type SMTP

type SMTP struct {
	Server   string `json:"server"`
	Port     int    `json:"port"`
	Username string `json:"username"`
	Password string `json:"password"`
	Alias    string `json:"alias"`
}

func LoadSMTPFromFile

func LoadSMTPFromFile(path string) (SMTP, error)

func (*SMTP) String

func (m *SMTP) String() string

Jump to

Keyboard shortcuts

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