Lighweight mock SMTP server for testing
8.7K
This is a lighweight mock SMTP server for testing.
This command will start mailmock, binding the SMTP server on local port 1025 and the HTTP server to local port 1080
docker run -ti --rm -p 1080:80 -p 1025:25 adrienaury/mailmock
Then use the HTTP API to read mails :
# All mails
http://localhost:1080/v1/api/mailmock
# Only 1 mail
http://localhost:1080/v1/api/mailmock?limit=1
# Only 1 starting at index 1
http://localhost:1080/v1/api/mailmock?from=1&limit=1
# Mail at index 2
http://localhost:1080/v1/api/mailmock/2
JSON response example:
{
"0": {
"mail": {
"envelope": {
"sender": "<[email protected]>",
"recipients": [
"<[email protected]>"
]
},
"content": [
"Subject: This is a test",
"",
"Hello World!"
]
},
"state": "completed",
"history": [
"MAIL FROM:<[email protected]>",
"250 OK",
"RCPT TO:<[email protected]>",
"250 OK",
"DATA",
"354 Start mail input; end with <CRLF>.<CRLF>",
"Subject: This is a test",
"",
"Hello World!",
".",
"250 OK"
]
}
}
Content type
Image
Digest
Size
11.5 MB
Last updated
about 7 years ago
docker pull adrienaury/mailmock