Fetching contributors…
Cannot retrieve contributors at this time
88 lines (72 sloc) 2.41 KB


MailDev provides an easily consumable REST API accessible at localhost:1080 unless configured otherwise. All data is returned as JSON unless specified.

Example email response

Get all emails:

$ curl 'http://localhost:1080/email'


    "name":"Angelo Pappas"
    "name":"Johnny Utah"
  "subject":"The ex-presidents are surfers",
  "text":"The wax at the bank was surfer wax!!!",
  "html":"<!DOCTYPE html><html><head></head><body><p>The wax at the bank was surfer wax!!!</p></body></html>",
    "content-type":"multipart/mixed; boundary=\"---sinikael-?=_1-14125357291310.1947895612102002\"",
    "from":"Angelo Pappas <>",
    "to":"Johnny Utah <>",
    "subject":"The ex-presidents are surfers",
    "x-mailer":"nodemailer (1.3.0; +; SMTP/0.1.13[client:1.0.0])",
    "date":"Sun, 05 Oct 2014 19:02:09 +0000",


GET /email - Get all emails

DELETE /email/all - Delete all emails

GET /email/:id - Get a given email by id

DELETE /email/:id - Delete a given email by id

GET /email/:id/html - Get a given emails html body

GET /email/:id/attachment/:filename - Get a given email's file attachment.

POST /email/:id/relay - If configured, relay a given email to it's real "to" address.

GET /config - Get the application configuration.