Categorygithub.com/davrux/go-smtptester
modulepackage
1.0.2
Repository: https://github.com/davrux/go-smtptester.git
Documentation: pkg.go.dev

# README

Go License: MIT

go-smtptester

Simple SMTP Server for Testing.

How it works

All received mails are saved in a sync.Map with a key:

From+Recipient1+Recipient2

Mails to the same sender and recipients will overwrite a previous received mail, when the recipients slice has the same order as in the mail received before.

Example

See

server_test.go
examples/simple/main.go

for example usage.

# Packages

No description provided by the author

# Functions

GetBackend returns the concrete type *Backend from SMTP server.
LookupKey returns a key of the format: m.From+m.Recipient_1+m.Recipient_2...
NewBackend returns a new Backend with an empty (not nil) Mails map.
Standard returns a standard SMTP server listening on :2525.

# Structs

Backend is the backend for out test server.
Mail is one mail received by SMTP server.
A Session is returned after successful login.