Use SMTP when your app, framework or device can only send mail that way: WordPress plugins, CMSs, printers, legacy apps. Anything that speaks SMTP can send through Mailcandor.
SMTP settings
| Setting | Value |
|---|---|
| Host | smtp.mailcandor.com |
| Port | 465 (TLS) or 587 (STARTTLS) |
| Encryption | SSL/TLS on 465, STARTTLS on 587 |
| Authentication | PLAIN or LOGIN |
| Username | mailcandor |
| Password | an API key, mc_live_... |
A sending-only API key is the right choice: it can send and nothing else. You can limit it to one domain. See Create an API key.
To set it up
- Verify your sending domain under Domains.
- Create a sending-only API key under API keys and copy it.
- In your app’s mail settings, enter the values above.
- Set the From address to an address on your verified domain.
- Send a test message. It appears under Emails a moment later.
Example: Nodemailer
import nodemailer from 'nodemailer';
const transport = nodemailer.createTransport({
host: 'smtp.mailcandor.com',
port: 587,
secure: false, // STARTTLS
auth: { user: 'mailcandor', pass: process.env.MAILCANDOR_KEY },
});
await transport.sendMail({
from: 'Acme <hello@acme.com>',
to: 'sam@example.com',
subject: 'Your login code',
text: 'Your code is 481 203',
});
Example: Laravel .env
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailcandor.com
MAIL_PORT=587
MAIL_USERNAME=mailcandor
MAIL_PASSWORD=mc_live_your_key
MAIL_FROM_ADDRESS=hello@acme.com
How messages are handled
The relay turns each message into one POST /v1/emails with your key, so SMTP follows the same rules, limits and log as the API.
- To, Cc, Bcc: taken from the headers. Envelope recipients that are not in To or Cc become Bcc. At least one To address is required.
- Recipients: up to 50 per message.
- Size: up to 40 MB per message.
- Headers: custom headers starting with
X-are kept. Other custom headers are dropped. - Attachments and inline images: kept, including
cid:images. - Idempotency: add
Mailcandor-Idempotency-Key: <unique value>to the message headers and a retry with the same value does not send twice. - Rate limit: SMTP shares your team’s per-second limit with the API.
If it does not work
SMTP replies carry the same plain-English message as the API.
| Reply | Meaning | Fix |
|---|---|---|
535 5.7.8 Use the username "mailcandor" and an API key as the password. |
Wrong username or empty password | Set username mailcandor. |
550 5.7.1 ... |
The key is invalid or revoked, the domain is not verified, or sending is paused | Read the message; check the key and the From domain. |
554 5.6.0 ... |
Something in the message is wrong, such as a missing To | Fix the message. The text says what. |
452 4.5.3 Send to at most 50 recipients per message. |
Too many recipients | Split the message. |
552 5.3.4 The message is over 40 MB. |
Too big | Link to large files instead. |
451 4.7.1 ... |
Rate limit or daily quota reached | Your client retries later. |
- Connection refused or times out: your network may block outbound ports 465 and 587. Try the other port, or ask your host. Some cloud providers block SMTP ports by default.
- TLS errors: use SSL/TLS on 465 and STARTTLS on 587. Do not use plain, unencrypted SMTP: sign-in is refused.
See Rate limits and the API reference at docs.mailcandor.com.