Videos
Check out our tutorial video series.
Prevent HTTP timeouts and socket exceptions when calling the MailSlurp API by configuring client timeouts within your SDK client.
MailSlurp uses 'Keep-Alive' connections for many endpoints to allow your code to wait for conditions.
It is important to set a connection timeout on the client and its underlying http client implementations when using the MailSlurp SDKs.
For example, in Java pass an instance to the
and set
,
and
timeouts.
This will help to avoid errors that you may encounter with default timeout settings.
The same approach applies to other languages.
Sometimes connection exceptions can occur in testing frameworks such as or
. We recommend setting similar timeouts for your test framework. In Javascript
this looks like:
Most MailSlurp operations take several seconds. Waiting for emails is different and can take up to 120 seconds depending on the number of emails you are waiting for and the load on MailSlurp servers. Most clients take timeout values in milliseconds.
If your connection or 502 errors continue please contact support and provide code examples so we can debug the issue further.
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.