Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.
/ go-smtpsrv Public archive

a tiny package that implements SMTP server for Go projects

License

Notifications You must be signed in to change notification settings

alash3al/go-smtpsrv

Repository files navigation

A SMTP Server Package

a simple smtp server library for writing email servers like a boss.

Quick Start

go get github.com/alash3al/go-smtpsrv

package main

import (
	"fmt"

	"github.com/alash3al/go-smtpsrv/v3"
)

func main() {
	handler := func(c smtpsrv.Context) error {
		// ...
		return nil
	}

	cfg := smtpsrv.ServerConfig{
		BannerDomain:  "mail.my.server",
		ListenAddr: ":25025",
		MaxMessageBytes: 5 * 1024,
		Handler:     handler,
	}

	fmt.Println(smtpsrv.ListenAndServe(&cfg))
}

Thanks