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 ¶
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.
Click to show internal directories.
Click to hide internal directories.