package
module
Version:
v1.0.0
Opens a new window with list of versions in this module.
Published: Dec 8, 2024
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
smtp v1
A Go package that provides a simple interface for sending emails via SMTP.
Installation
go get -u github.com/metadiv-io/smtp
Documentation
smtp v1
Documentation
¶
- Variables
-
func EmailList(emails ...string) []string
-
type Dialer
-
func (d *Dialer) SendHTMLEmail(to, cc, bcc []string, subject, body string, valuesMap ...map[string]string) error
-
func (d *Dialer) SendTextEmail(to, cc, bcc []string, subject, body string, valuesMap ...map[string]string) error
EmailList returns a list of emails.
type Dialer struct {
DisplayName string `json:"display_name"`
Host string `json:"host"`
Port int `json:"port"`
Username string `json:"username"`
Password string `json:"password"`
}
Dialer is a SMTP dialer.
func NewDefaultDialer() *Dialer
NewDefaultDialer creates a new SMTP dialer with the default environment variables.
NewDialer creates a new SMTP dialer.
SendHTMLEmail sends an HTML email.
valuesMap is a map of key-value pairs that will be used to replace the placeholders in the subject and body.
SendTextEmail sends a text email.
valuesMap is a map of key-value pairs that will be used to replace the placeholders in the subject and body.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.