Generate test email accounts and real inboxes in Golang using MailSlurp SDKs. Free for personal use, send and receive emails and attachments in Go code and tests. MailSlurp's free email API enables teams and developers to create email mailboxes on demand then control email accounts in code and applications.

Get started

MailSlurp has an official Golang package and support for Go SMTP clients.

Installing

Install the MailSlurp golang package from github using go get and go mod.

You may also need these dependencies:

To configure the MailSlurp client obtain a free API Key. Then import the libraries:

Example

Here is a short example using and to create email addresses, send emails and receive them.