Email in code examples
See MailSlurp in action with code examples or interactive demo app. Use C#, Java, PHP, Javascript and more to control email addreses.
Please see github.com/mailslurp/examples for code examples in several languages.
- See documentation for how to use the SDKs in your language.
- Try the API explorer to see the API in action.
Getting started with MailSlurp
The quickest way to start using MailSlurp is to sign up for an account and create an inbox. Then configure an SMTP client to use your SMTP username and password with the standard MailSlurp SMTP server host at mx.mailslurp.com:2525
.
Using SDK clients
MailSlurp offers many SDK libraries for developers. The recommended client is the NPM javascript library.
npm install --save mailslurp-client
Then configure the client like so:
import { MailSlurp } from "mailslurp-client";
const mailslurp = new MailSlurp({ apiKey: process.env.API_KEY })
Then create a real email address using the createInbox
method.
const inbox = await mailslurp.createInbox();
console.log(inbox);