How to configure an SMTP relay: step by step
Host, port, user and pass, TLS, testing with swaks and openssl, DKIM and the 535/550/554 errors explained.
How to configure an SMTP relay: step by step
Configuring an SMTP relay comes down to four parameters in your app: host mail.yourtrend.online, port 587 (STARTTLS) or 465 (SSL/TLS), the username is the full mailbox address, and the mailbox password. Then you publish DKIM, test sending with swaks or openssl, and read the server replies. Here is the full sequence and the common errors.
Step 1. Connection details
Add a domain in the panel, create a mailbox and open its settings. You will get:
SMTP host : mail.yourtrend.online
SMTP port : 587 (STARTTLS) | 465 (implicit TLS)
Username : noreply@yourdomain.com
Password : <mailbox password>
Auth : LOGIN / PLAIN over TLS
Port 587 fits almost everyone and is the default recommendation; use 465 if your library wants TLS "from the first byte". Port 25 is not used for submission.
Step 2. Example setup (WordPress / PHPMailer)
$mail->isSMTP();
$mail->Host = 'mail.yourtrend.online';
$mail->SMTPAuth = true;
$mail->Username = 'noreply@yourdomain.com';
$mail->Password = 'SECRET';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // 'tls'
$mail->Port = 587;
$mail->setFrom('noreply@yourdomain.com', 'YourBrand');
In WP Mail SMTP plugins enter the same host, port, STARTTLS encryption, username and password. The From address must be on your verified domain, otherwise SPF and DKIM will not align.
Step 3. Test with swaks
swaks --server mail.yourtrend.online:587 --tls \
--auth LOGIN \
--auth-user noreply@yourdomain.com \
--auth-password 'SECRET' \
--from noreply@yourdomain.com \
--to you@gmail.com \
--header 'Subject: SMTP relay test'
In the dialogue look for <- 235 Authentication succeeded (auth OK) and the final <- 250 OK id=... (message accepted for delivery).
Step 4. Check TLS with openssl
Confirm the port answers and presents a certificate:
# STARTTLS on 587
openssl s_client -starttls smtp -crlf \
-connect mail.yourtrend.online:587
# implicit TLS on 465
openssl s_client -crlf -connect mail.yourtrend.online:465
After the handshake you can type EHLO test and see 250-AUTH LOGIN PLAIN and 250-STARTTLS in the reply — the server is ready to accept authenticated submission.
Step 5. DKIM signing
YourTrend signs outgoing mail automatically with the mail selector. Publish this TXT record in your domain's DNS so the signature validates at recipients:
Type Host Value
TXT mail._domainkey v=DKIM1; k=rsa; p=MIGfMA0GCSq...IDAQAB
The exact p= value is shown in the domain card ("DNS records" button). While you are there, verify SPF v=spf1 ip4:5.39.41.216 ~all and DMARC v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com. Check publication in the deliverability lab.
Common errors and fixes
| Code | Meaning | Fix |
|---|---|---|
| 535 | Authentication failed | Wrong user/password. The username is the full mailbox address; reset the password in the panel; ensure AUTH runs over TLS. |
| 550 | Mailbox unavailable / relay denied | Recipient missing, or From is not on a verified domain. Check the address and the verified status. |
| 554 | Transaction failed / rejected | Content flagged as spam or a blocklist hit. Warm up the domain, check the spam score, set DKIM/DMARC. |
| 421 | Service not available / rate | Too many connections. Lower concurrency, retry with backoff. |
Pre-production checklist
- SPF, DKIM (
mail._domainkey) and DMARC published, domain verified. swaksreturns235and250 OK; mail lands in Gmail and Outlook, not spam.- Transactional and bulk mail split into separate streams.
- Retries configured for
421/4xxcodes.
Prefer REST over SMTP? The same relay is available as an HTTP API; see the documentation and the overview of how to choose an SMTP service. Volume tiers are on the pricing page.
Where to see the delivery result
The relay accepting a message (250 OK) is not yet delivery to the recipient's inbox. The final fate is shown in the send log in the panel: statuses sent, delivered, bounced, complained, the rejection reason and the event time. For transactional mail, enable webhooks to receive these events in your app and, for example, auto-move hard bounces to the suppression list. If a message left with 250 OK but didn't arrive, it's almost always reputation or authentication: check that DKIM is published and valid, SPF contains our egress IP, and DMARC isn't at a hard reject on misalignment. Self-diagnosis tools (spam score, blocklist check, address validator) are available without login in the deliverability lab. Prune non-existent addresses regularly — a high bounce rate hurts your domain's reputation and raises the odds of landing in the Gmail and Outlook spam folder.
Connection pooling and concurrency
For bulk sending, don't open a new TLS connection per message — it's slow and invites a 421. Keep a pool of a few persistent connections and reuse them, sending several messages in one session (SMTP pipelining). A sensible start is 5–10 parallel connections growing gently as you warm up; watch the server replies and back off on 4xx. Set timeouts explicitly (connect and read at 10–30 seconds), and push failed messages to a retry queue with exponential backoff rather than an infinite loop. This gives steady throughput without risking temporary blocks or needless load on the relay.
On this page
← All articlesOne click. It tells us what to write next.
No ratings yet — yours would be the first.
Comments
Comments are read before they appear.