BuildMIME
Overview
BuildMIME exposes MIME encoding for tests and custom transports.
Part of the mail package — Node.js analog: nodemailer.
Signature
go
func BuildMIME(msg Message) []byteCompare: 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"
raw := mail.BuildMIME(msg)Example
go
import "github.com/sahilkhaire/gox/mail"
raw := mail.BuildMIME(msg)Tips
Import github.com/sahilkhaire/gox/mail and call BuildMIME directly. See the comparison below for the standard library equivalent.
Standard library alternative
Use the standard library directly:
go
smtp.SendMail(addr, auth, from, to, msg)