SMTP: your existing software sends through us
SMTP is the standard way mail programs and servers hand email to each other. Almost all software that can send email supports it. You fill in six details and you are done.
What you use it for
You use SMTP for all the software you did not write yourself. You build no integration; you fill in our mail server details.
-
Software someone else wrote
A shop, an accounting system, a CRM or a ticket system. They all have a screen with mail server settings. That is where our details go.
-
An integration that already exists
Sending through your hosting provider's mail server today? Then you replace those details with ours and nothing else changes, not your code and not your templates.
-
WordPress without the handwork
For WordPress there is our plugin: it takes over sending from WordPress and hands the email to us. Prefer SMTP anyway, then any SMTP plugin works with the details from the table under 'How it works'.
How it works
You need six details. There is one port and one login method.
| What | Value |
|---|---|
| Server | smtp.sendpier.com |
| Port | 587 |
| Encryption | STARTTLS (some programs call this TLS) |
| Login method | AUTH LOGIN |
| Username | per domain name, in the panel under SMTP details |
| Password | per domain name; shown in the clear exactly once when you create it |
- Server
- smtp.sendpier.com
- Port
- 587
- Encryption
- STARTTLS (some programs call this TLS)
- Login method
- AUTH LOGIN
- Username
- per domain name, in the panel under SMTP details
- Password
- per domain name; shown in the clear exactly once when you create it
Your credentials
- The login belongs to one domain name and looks like this: sp_1234_a8k2x9. Send from three domain names and you have three logins.
- The password is readable once, at the moment you create it. After that you only see dots.
- If you lose the password, you create a new one. From that moment the old one works nowhere.
- There is one active login per domain name at a time.
Which sender address is allowed
noreply@yourdomain.com
Any sender address on a verified domain name can be used to send email
What it looks like in your code
These snippets come straight from our knowledge base. Fill in your own username and keep the password out of your code: put it in a separate settings file on your server, such as .env.
PHP (PHPMailer)
$mail->isSMTP();
$mail->Host = 'smtp.sendpier.com';
$mail->Port = 587;
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->SMTPAuth = true;
$mail->AuthType = 'LOGIN';
$mail->Username = 'sp_XXX_XXXXXXXX';
$mail->Password = getenv('SENDPIER_SMTP_PASSWORD');
In PHPMailer set AuthType to LOGIN, or leave it on automatic.
Node.js (Nodemailer)
const transport = nodemailer.createTransport({
host: 'smtp.sendpier.com',
port: 587,
secure: false,
requireTLS: true,
auth: {
user: 'sp_XXX_XXXXXXXX',
pass: process.env.SENDPIER_SMTP_PASSWORD,
},
});
secure: false does not mean unencrypted here. It means the connection simply starts and then switches over to encryption. With requireTLS: true Nodemailer refuses to send if that switch to STARTTLS fails.
Python (smtplib)
import os, smtplib, ssl
with smtplib.SMTP("smtp.sendpier.com", 587, timeout=10) as smtp:
smtp.ehlo()
smtp.starttls(context=ssl.create_default_context())
smtp.ehlo()
smtp.login("sp_XXX_XXXXXXXX", os.environ["SENDPIER_SMTP_PASSWORD"])
smtp.send_message(message)
Set a timeout: a maximum for how long your program waits for an answer. Ten seconds is generous; without one your process hangs when something in between goes wrong.
Laravel
MAIL_MAILER=smtp
MAIL_HOST=smtp.sendpier.com
MAIL_PORT=587
MAIL_ENCRYPTION=tls
MAIL_USERNAME=sp_XXX_XXXXXXXX
MAIL_PASSWORD=…
MAIL_FROM_ADDRESS=noreply@yourdomain.com
In Laravel, MAIL_ENCRYPTION=tls on port 587 means STARTTLS. That is the right setting.
Command line
swaks --server smtp.sendpier.com --port 587 --tls \
--auth LOGIN \
--auth-user "sp_XXX_XXXXXXXX" \
--auth-password "$SENDPIER_SMTP_PASSWORD" \
--from "noreply@yourdomain.com" \
--to "recipient@example.org" \
--header "Subject: Test" \
--body "Test"
If this works, a problem sits in your application and not in your credentials.
What SMTP does not give you
SMTP and the Send API hand over to the same infrastructure; only the way you hand it over differs. What stays the same: the limits, the statuses you see back in the panel, and the suppression list, the addresses we no longer send to on your behalf. The DKIM signature stays the same too, the digital signature that lets receivers see an email really comes from your domain name. This is the difference.
| What | SMTP | Send API |
|---|---|---|
| Identifier per message to look up later | no | yes |
| Attachments | yes, built by you | yes, sent along in the request |
| Sending a stored template | no | yes, with template_id |
| Choosing a message stream per message | through an extra line in the email: X-SP-Stream | through the stream field |
| Turning tracking on or off per message | no, only per domain name | yes |
| Feedback on delivery | webhooks or the panel | the same, and you can look the message up on its identifier |
Identifier per message to look up later
- SMTP
- no
- Send API
- yes
Attachments
- SMTP
- yes, built by you
- Send API
- yes, sent along in the request
Sending a stored template
- SMTP
- no
- Send API
- yes, with template_id
Choosing a message stream per message
- SMTP
- through an extra line in the email: X-SP-Stream
- Send API
- through the stream field
Turning tracking on or off per message
- SMTP
- no, only per domain name
- Send API
- yes
Feedback on delivery
- SMTP
- webhooks or the panel
- Send API
- the same, and you can look the message up on its identifier
You can use both ways side by side for the same domain name. Your shop hands over through SMTP, your own code through the API. What you send over SMTP still shows up in the panel and in your webhooks. Only the identifier to look a message up later is missing.
What the limits are
These limits do not change with your plan. Better to read them now than in an error message later.
- One port: 587
- Everything runs over port 587 with STARTTLS; ports 465 and 25 are not open with us. If you let your software pick the login method itself, it lands on AUTH LOGIN; that is the only method we offer.
- No login, no entry
- Anyone offering email without signing in gets the error 5.7.0 Authentication required before sending mail. Without a login we send nothing, because otherwise anyone could mail through us.
- 500 a month per domain name, and a daily limit that grows
- The same limits apply as through the API. Every domain name starts at 100 emails a day. That daily limit grows as long as your email arrives well. The day runs from midnight to midnight in UTC, universal time. Credits do not raise the daily limit. Go past it and we refuse the message temporarily, and your software may try again later.
- 25 MB per message
- Message and attachments together may be 25 MB, measured as the real file size. If one attachment is refused, we refuse the whole message: we never send a message with part of the attachments missing.
- We only send
- We deliver outgoing email. There are no mailboxes and no incoming email; those belong with your hosting or mail provider.
The answers you can get
If an answer starts with a 4 it is temporary and your software should try again later. If it starts with a 5 it is final.
| Answer | What is going on |
|---|---|
| 5.7.0 Authentication required before sending mail | you are not sending a username and password |
| 535 5.7.8 Authentication failed | the username or the password is wrong |
| 454 4.3.0 Temporary authentication problem | we could not check your details just now; try again shortly |
| 504 5.7.4 Unrecognized authentication type | your software is trying a method other than LOGIN |
| 5.7.1 You may only send from addresses @… with this SMTP login | your sender address does not belong to this domain name |
- 5.7.0 Authentication required before sending mail
- you are not sending a username and password
- 535 5.7.8 Authentication failed
- the username or the password is wrong
- 454 4.3.0 Temporary authentication problem
- we could not check your details just now; try again shortly
- 504 5.7.4 Unrecognized authentication type
- your software is trying a method other than LOGIN
- 5.7.1 You may only send from addresses @… with this SMTP login
- your sender address does not belong to this domain name
The return address is not the From: line
Do not confuse the technical return address with the From: line your recipient sees. Plenty of software has two separate fields for those. Our check on your domain name looks at the technical return address, also known as the envelope sender. This is the most common cause of a 5.7.1 on a new integration.
Move your software over to SendPier
Create an account, verify your domain name and fetch your SMTP details. The free plan has no end date.