Documentation ¶
Overview ¶
Package smtptarget offers a replacement for common uses of smtp.SendMail() with support for persistent connections. In the name of simplicity it only supports plain auth protected by TLS. It is thread safe, but operations will not be executed in parallell.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Target ¶
type Target struct {
// contains filtered or unexported fields
}
Target represents a destination to which mail may be sent
func New ¶
New creates a new Target to which you can send mail. host should be a host and port in the format "smtp.example.com:587". Username and password are required. Anonymous authentication is not supported. timeout is how long the connection will be allowed to sit idle before it is disconnected. It will automatically re-connect next time you call SendMail().
func (*Target) Close ¶
Close the connection to the SMTP server and end the possibleTimeout watcher thread. The Target cannot be used after this. You must make a new one.
func (*Target) EnableKeyLog ¶
EnableKeyLog will start writing TLS secrets to a file. See: https://wiki.wireshark.org/TLS#Using_the_.28Pre.29-Master-Secret