SMTPConfig
Overview
SMTPConfig holds SMTP connection settings.
Part of the mail package — Node.js analog: nodemailer.
SMTPConfig is a type exported by gox. Methods on this type are documented separately.
Signature
go
type SMTPConfig struct {
Host string
Port int
User string
Pass string
TLS bool // use implicit TLS (SMTPS) when true
}Compare: Node.js · Standard Go · gox
js
// Typical nodemailer pattern in Node.jsgo
smtp.SendMail(addr, auth, from, to, msg)go
import "github.com/sahilkhaire/gox/mail"
cfg := mail.SMTPConfig{
Host: "smtp.example.com",
Port: 587,
Username: "user",
Password: "pass",
}Example
go
import "github.com/sahilkhaire/gox/mail"
cfg := mail.SMTPConfig{
Host: "smtp.example.com",
Port: 587,
Username: "user",
Password: "pass",
}Tips
Browse methods on this type in the sidebar for handler-style APIs and options structs.
Standard library alternative
Use the standard library directly:
go
smtp.SendMail(addr, auth, from, to, msg)