Skip to content
Node: nodemailergithub.com/sahilkhaire/gox/mail

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) []byte

Compare: Node.js · Standard Go · gox ​

js
// Typical nodemailer pattern in Node.js
go
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)

← Back to mail package overview

MIT Licensed · Built for Node.js developers moving to Go