Documentation
¶
Overview ¶
Package mail provides a lightweight, modular Go email delivery package supporting multiple backend providers.
Supported providers include:
- Standard SMTP (with optional plain authentication)
- AWS SES v2 (using standard AWS SDK credential resolution)
- Oracle Cloud Infrastructure (OCI) Email Delivery via SMTP
Quick Start ¶
appConfig, err := config.Load("config.yaml")
if err != nil {
log.Fatal(err)
}
if err := mail.Init(appConfig); err != nil {
log.Fatal(err)
}
err = mail.Send("user@example.com", "Welcome", "<h1>Hello</h1>")
For full details and examples, visit https://github.com/more-shubham/mail.
Example ¶
Example demonstrates loading configuration and initializing the mail package.
package main
import (
"fmt"
"log"
mail "github.com/more-shubham/mail"
"github.com/more-shubham/mail/config"
)
func main() {
appConfig, err := config.Load("config.yaml")
if err != nil {
log.Fatal(err)
}
if err := mail.Init(appConfig); err != nil {
log.Fatal(err)
}
if err := mail.Send("user@example.com", "Welcome to Our Platform", "<h1>Hello from Mail!</h1>"); err != nil {
log.Fatal(err)
}
fmt.Println("Email sent successfully")
}
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.