Our REST API facilitates programmatic access to the e-mails captured by our fake SMTP server. We support the following operations:

 

Search for e-mails

You can search by sender or recipient (or both). At least one of the two must be provided.

Request

Resource https://api.smtpbucket.com/emails
Method GET
Query Parameters
sender The sender's email address
recipient The recipient's email address

Response

The "results" field contains a list of matching e-mails in summary form. For each e-mail we return the following data:

id A unique identifer for this e-mail
sender The sender's email address
recipients A list of e-mail addresses this e-mail would have been delivered to
subject The e-mail's subject line (if provided)
timeCreated The time this e-mail was received by SMTP Bucket, in milliseconds since 00:00 January 1, 1970 (UTC)

Example

GET https://api.smtpbucket.com/emails?sender=sender%40example.com&recipient=recipient%40example.com

{
  "results": [
    {
      "id": "2c9080c356db0d5f0156db35315a0000",
      "sender": "sender@example.com",
      "recipients": [
        "recipient@example.com"
      ],
      "subject": "This is the subject line!",
      "timeCreated": 1472556512000
    },
    {
      "id": "3c9080c356db0d5f0156db35315a0000",
      "sender": "sender@example.com",
      "recipients": [
        "recipient@example.com"
      ],
      "subject": "This is the subject line!",
      "timeCreated": 1472556511000
    }
  ]
}

 

Get e-mail

Use the unique identifier returned by 'Search for e-mails' to retrieve full details for a specific e-mail

Request

Resource https://api.smtpbucket.com/emails/{id}
Method GET

Response

id A unique identifer for this e-mail
sender The sender's email address
recipients A list of e-mail addresses this e-mail would have been delivered to
subject The e-mail's subject line (if provided)
body The original message body. In most cases, this will be a MIME encoded e-mail message
timeCreated The time this e-mail was received by SMTP Bucket, in milliseconds since 00:00 January 1, 1970 (UTC)

Example

GET https://api.smtpbucket.com/emails/2c9080c356db0d5f0156db35315a0000

{
    "id" : "2c9080c356db0d5f0156db35315a0000",
    "sender" : "sender@example.com",
    "recipients" : [ "recipient@example.com" ],
    "subject" : "This is the subject line!",
    "body" : "From: sender@example.com\r\nTo: recipient@example.com\r\nMessage-ID: <51228289.0.1472556511530@My-PC.lan>\r\nSubject: This is the subject line!\r\nMIME-Version: 1.0\r\nContent-Type: text/plain; charset=us-ascii\r\nContent-Transfer-Encoding: 7bit\r\n\r\nThis is the message body!\r\n",
    "timeCreated" : 1472556512000
}

 

Delete e-mail

Use the unique identifier returned by 'Search for e-mails' to permanently delete a specific e-mail

Request

Resource https://api.smtpbucket.com/emails/{id}
Method DELETE

Example

DELETE https://api.smtpbucket.com/emails/2c9080c356db0d5f0156db35315a0000