SMTP setup for WordPress, Laravel and Node.js

· 1 min read

SMTP settings for WordPress, Laravel and Node.js (Nodemailer) to send from your own domain on port 465 or 587, plus fixes for connection problems.

SMTP settings for WordPress, Laravel and other apps

Most systems, such as WordPress, Laravel or accounting software, can already send email over SMTP. Switching the server from your web host to a dedicated email service gets more mail into the inbox and gives you a log of every message.

Bytesms settings

Setting Value
Host smtp.bytesms.com
Port 465 (SSL/TLS) or 587 (STARTTLS)
Username bytesms
Password An API key starting with tp_live_
From An address on a verified domain

Some cloud providers block outbound ports 465 and 587. If you can't connect, try port 2465 (TLS) or 2587 (STARTTLS).

WordPress

  1. Install an SMTP plugin such as WP Mail SMTP or FluentSMTP
  2. Choose Other SMTP and enter the values from the table, with SSL encryption for port 465
  3. Set From Email to an address on your verified domain and force that From address
  4. Send a test email from the plugin page

Laravel

MAIL_MAILER=smtp
MAIL_HOST=smtp.bytesms.com
MAIL_PORT=465
MAIL_USERNAME=bytesms
MAIL_PASSWORD=tp_live_xxxxxxxxx
MAIL_ENCRYPTION=ssl
MAIL_FROM_ADDRESS=no[email protected]
MAIL_FROM_NAME="Your Shop"

Node.js (Nodemailer)

import nodemailer from "nodemailer";

const transporter = nodemailer.createTransport({
  host: "smtp.bytesms.com",
  port: 465,
  secure: true,
  auth: { user: "bytesms", pass: process.env.BYTESMS_API_KEY },
});

await transporter.sendMail({
  from: "Your Shop <[email protected]>",
  to: "[email protected]",
  subject: "Your verification code",
  text: "Your code is 482913. It expires in 10 minutes.",
});

Common problems

Symptom Cause and fix
Can't connect / timeout The port is blocked outbound. Try 2465 or 2587
535 authentication failed Wrong API key, or the key was deleted
538 encryption required On port 587, start STARTTLS before logging in
553 sender not allowed From isn't on a verified domain yet
554 attachments Attachments aren't supported yet; send a download link instead

More articles