Videos
Check out our tutorial video series.
How to Use MailSlurp Go Library to Manage Email Processes and Perform Tests with Test Email Addresses and Assert Libraries.
MailSlurp has an official Go library hosted on GitHub. You can use this library to call the MailSlurp API in Go!
Let's use MailSlurp to test email related processes using the popular library for assertions.
First add MailSlurp:
We will also add test libraries and context:
Now create a test file called . Import and configure MailSlurp in your test like so:
We can now create MailSlurp API clients using
MailSlurp inboxes can be created on demand and have an ID and an email address.
Let's see how you create one:
You can send emails in Go tests by first creating an inbox and then using the method:
MailSlurp is unique in allowing you to receive emails in Go. No MailServer is required.
First create an inbox then use the methods to wait for unread emails to arrive.
You can receive emails using the :
See the source code for full method documentation.
Check out our tutorial video series.
Email and SMS guides for automation and testing.
View github project code for multiple languages.
Latest posts from the MailSlurp team.
Test, build, and automate messaging with a free MailSlurp account.