Advanced send options

By adding special properties to the input JSON you can enable or disable specific SMTPeter features. You can for example enable click, open and bounce tracking, or you can tell SMTPeter to inlinize your CSS code.

{
    "recipient":    "john@doe.com",
    "mime":         "MIME-Version: 1.0\r\nFrom: <info@example.com>\r\n....",
    "inlinecss":    true,
    "trackclicks":  true,
    "trackopens":   false,
    "trackbounces": true,
    "preventscam":  true, 
    "tags": [
        "tag1",
        "tag2"
    ],
    "maxdelivertime": "YYYY-MM-DD hh:mm:ss"
}

Inlinize CSS code

By setting the "inlinecss" variable to true you enable the feature that CSS stylesheets in the header of your email are converted into inline style attributes in the HTML code. Because of how some email clients handle CSS a standard stylesheet might cause your email to look different than intended. See the article on inline CSS for more background and how to prevent this.

Tracking clicks, opens and bounces

SMTPeter automatically replaces all hyperlinks in your messages with its own URLs so that it can track clicks and opens. The envelope address of the mailing will also be set to a SMTPeter address, so that all bounces and out-of-office replies are tracked by SMTPeter. If you want to disable these tracking settings, you can include the "trackclicks", "trackopens" and "trackbounces" options, and set them to false:

{
    "recipient":    "john@doe.com",
    "mime":         "MIME-Version: 1.0\r\nFrom: <info@example.com>\r\n....",
    "trackclicks":  false,
    "trackopens":   false,
    "trackbounces": false
}

When click-tracking is enabled (which is the default), all hyperlinks in your email are modified to track the clicks. However, some email programs show a warning to the user when links are modified. This is especially the case if a link is modified in such a way that the clickable text does not match the actual hyperlink. You can add a "preventscam" property to tell SMTPeter not to modify these type of links:

{
    "recipient":    "john@doe.com",
    "mime":         "MIME-Version: 1.0\r\nFrom: <info@example.com>\r\n....",
    "trackclicks":  true,
    "preventscam":  true
}

The preventscam option prevents that SMTPeter modified hyperlinks like

<a href="http://www.example.com">www.example.com</a>

Settings for Delivery Status Notifications

If you do not want SMTPeter to track bounces for you, all bounces are sent sent back to your envelope address. If you want this, you must add the "envelope" address to the JSON too:

{
    "envelope":     "your@address.com",
    "recipient":    "john@doe.com",
    "mime":         "MIME-Version: 1.0\r\nFrom: <info@example.com>\r\n....",
    "trackbounces": false
}

The above JSON instructs SMTPeter to not track bounces, but to use your envelope for messages that could not be delivered. Be aware that you must add an envelope address to the JSON too to receive bounces!

With the optional "dsn" property you can further finetune what kind of Delivery Status Notification messages you want to receive. The "dsn" variable accepts a JSON object with four (optional) fields:

{
    "recipient":    "john@doe.com",
    "mime":         "MIME-Version: 1.0\r\nFrom: <info@example.com>\r\n....",
    "trackclicks":  true,
    "preventscam":  true,
    "dsn": {
        "notify": ,         "FAILURE",
        "ret":              "FULL",
        "envid":            "your-identifier",
        "orcpt":            "original@recipient.address.com"
    }
}

The "notify" property is the most important one: you can specify what kind of events should trigger an email notification. Possible values are "NEVER", "FAILURE", "SUCCESS" or "DELAY". A comma separated list of values is also supported.

The "ret" value may hold the values "FULL" or "HDRS" to specify whether the notification should hold the full original email, or just the headers.

The "envid" and "orcpt" fields can be used if you want to control what extra data will be included in the notifications. The value of the "envid" will be included in the "original-envelope-id" property of the returned status message, and the "orcpt" value is copied to the "original-recipient" property.

Setting for embedded images

Having embedded images in your MIME may give some issues. SMTPeter can remove the embedded images from your MIME, host them and rewrite the links in the HTML part of the MIME to the remote location to prevent issues. The option can be enabled to set the "images" property in the JSON to "hosted". The default is "default", which simply does nothing.

{
    ...,
    "images": "hosted"|"default"
}

Tagging a mail

It is possible to add one or more tags to a mail. These tags can for example be used to track the number of clicks or opens for a certain mailing. For example, you send a special summer sale mailing and are curious how much opens and clicks this mailing generates. In this case you can tag each mail that belongs to this mailing with the tag summerSale2016. Subsequently, you can filter the opens and click on this tag summerSale2016 to see how many clicks and opens this mailing has generated. Tags can be added as an array via the tags property in the json like:

{
    ...,
    "tags" : [
        "tag1",
        "tag2",
        ...
    ],
    ...
}

It is not allowed to have white-spaces or semicolons in your tags.

Set a deliver time

Delivering an email is not instant. E.g. the mail server of the receiving party is temporary offline. If you do not want to have your mail delivered after a specific time anymore you can add the maxdelivertime property to your json with a string containing the data and time up to which a message should be delivered. You can do this like:

{
    ...,
    "maxdelivertime" : "YYYY-MM-DD hh:mm:ss",
    ...
}

Note that the the date time should be in UTC and that format is rather strict. If the maxdelivertime is exceeded your message will not be delivered. You can track theses cases by checking the failure.logs. Note that as a default SMTPeter only tries to deliver a message for one day.

Resend a message

When you have submitted a message to one of SMTPeter's APIs and received a message id as response, you are able to resend this message based on its id. You do this by making a HTTP POST request to www.smtpeter.com/v1/resend in which you only provide message as parameter:

{
    "message": "aaabbbcccxxxzzz"
}

The message is then rebuilt based on all parameters from the original message. The content and headers remain the same. Messages based on templates do not change when the template was changed in the meantime.

When resending a message, a new message id is generated. Events on the resent message are linked to this new message id.

More information