Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 669 Bytes

README.md

File metadata and controls

29 lines (24 loc) · 669 Bytes

Postbox 📬

A small library for constructing RFC 2822 style multipart messages. This library could be used to interact with a SMTP server to send mail.

package main

import (
	"strings"

	"github.com/jeroenrinzema/postbox"
)

func main() {
	body := postbox.Part{
		ContentType: "message",
		Encoding:    postbox.Base64,
		Reader:      strings.NewReader("https://www.youtube.com/watch?v=dQw4w9WgXcQ"),
	}

	mail := postbox.Envelope{
		From:    "[email protected]",
		Sender:  "[email protected]",
		ReplyTo: "[email protected]",
		To:      []string{"[email protected]", "[email protected]"},
		Subject: "Check this out!",
		Parts:   []*postbox.Part{&body},
	}
}