email

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package email provides a driver to send the message by the email.

Index

Constants

View Source
const DriverType = "email"

DriverType represents the driver type "email".

Variables

This section is empty.

Functions

func New

func New(config map[string]interface{}) (driver.Driver, error)

New returns a new driver, which sends the message by the html email, which is registered as the driver builder with name "email" and type DriverType by default.

config options:

addr(string, required): the mail server address, such as "mail.examole.com".
from(string, required): the adddress to send email, such as "username@mail.example.com".
username(string, required): the username to login the mail server, such as "username@mail.example.com".
password(string, required): the password to login the mail server, such as "password".
forcetls(int|int64|uint|uint64|string|bool, optional): if true, force to use TLS. For integer, 0 is false else true.
timeout(int|int64|uint|uint64|string, optional): the timeout. If integer, stand for second. default 3s.
idletimeout(int|int64|uint|uint64|string, optional): time idle timeout. If integer, stand for second. default 1m.
maxconnnum(int|int64|uint|uint64, optional): the maximum number of the connection, default 100.

If addr does not contain the port, use 465 if forcetls is true else 25.

Notice: The returned driver supports the comma-separated receiver list.

Types

This section is empty.

Jump to

Keyboard shortcuts

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