Skip to content

sadasidha/MockSMTP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MockSMTP

Written to Make Testing easier that handle emails

Http Server Info

  • Bind Addres: localhost
  • Bind Port: 8500

Http commands

Accept only GET

  • Start SMTP Server
# default localhost:2525
curl http://localhost:8500/toggol
# result
{"success":true,"status":true}

curl http://localhost:8850/toggol?hostname=localhost&port=2525
# result
{"success":true,"status":false}
  • Get SMTP server status
curl http:localhost:8850/status

# response
{"success":true,"status":true}
  • Get all email information
curl "http://localhost:8500/messages"

# response
{"success":true,"data":{...}}
  • Read a signle email, this will also update as read by tester
curl "http://localhost:8500/messages?index=0&messageId=%3C992136656.0.1587882808639.JavaMail.johny@johny%3E"
# result
{"success":true,"data":{"0":{"readByTester":false,"from":"NoReply-JD \[email protected]\u003e","to":"[email protected]","subject":"Subject to change","mailBody":"\nWe are giong to change the whole idea of living\r\n","date":"Apr 26, 2020, 3:33:28 PM","messageId":"\u003c992136656.0.1587882808639.JavaMail.johny@johny\u003e","mimeVersion":"1.0","index":0,"attachments":{},"attachement":false,"contentType":"text/plain; charset\u003dUTF-8","contentTransferEncoding":"7bit","format":"flowed"}}}
  • Remove email
curl "http://localhost:8500/delete"
# response
{"success":false}

 curl "http://localhost:8500/delete?index=0&messageId=%3C992136656.0.1587882808639.JavaMail.johny@johny%3E"
{"success":true}

Missing Options

Attachment handling

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published