Most of the time, the standard Sailthru API client will meet your needs, but there are some situations where it may be convenient to treat Sailthru as an SMTP server and send arbitrary transactional emails. These emails can use your templates and give you all the same tracking and reporting capabilities as any other Sailthru-powered email.
Email support@sailthru.com and request SMTP access. You will be given a password, which will appear on your settings page.
Go to the Templates interface and create a template called smtp. This will be the default template that will be used for SMTP emails.
Set the following values in each of your fields. You are populating these fields with special replacement variables that will be passed from every SMTP send.
| Field | Value |
|---|---|
| From Name | {smtp_from} |
| Subject | {smtp_subject} |
| HTML Content | {smtp_html} |
| Text Content | {smtp_text} |
This is a simple example. You are welcome to customize further. For example, it is best to put a standard header and footer around the {smtp_html} section. Standardizing your header and footer will improve deliverability.
Configure your app to send mail to smtp.sailthru.com, port 25.
Use login auth, and set the username to your API key, and the password to the SMTP password. Both are shown on your settings page.
Send mail as you would normally. The body of your HTML and/or text message will be passed into the smtp_html and smtp_text replacement variables, the subject line will be passed as smtp_subject
You can control various options by passing special X-Sailthru headers to the message.
| Header | Description | Example |
|---|---|---|
| X-Sailthru-Template | Use a different template than smtp. Pass the name of the template you want to use. | my-template-name |