SilLobby

How to Send Email from Your Website or App with SMTP (WordPress, Laravel, Node.js)

Stop contact-form and order emails going missing. Connect WordPress, WooCommerce, Laravel or Node.js to a proper SMTP service in minutes, with examples.

By SiloLobby Team 18 October 2026 6 min read
In this guide
  1. Why default website email fails
  2. How SMTP sending works
  3. Step 1: verify your sending domain
  4. Step 2: create SMTP credentials
  5. Step 3: connect your app
  6. Step 4: test and check authentication
  7. Ports and encryption
  8. Start in test mode
  9. Troubleshooting
  10. Security tips for SMTP credentials
  11. Monitoring your sending
  12. Choosing your From address
  13. SMTP or HTTP API?
  14. Summary

Short answer: to send reliable email from your website or app, sign up for an SMTP service, verify your sending domain by adding the DNS records it gives you, create SMTP credentials, and enter the host, port (587 or 465), username and password in your app's mail settings. Then send a test and check that SPF, DKIM and DMARC pass.

"Why didn't I receive the contact form message?" and "I never got my order confirmation" are two of the most common website problems. The cause is almost always the same: the website sends email straight from the web server, and inboxes do not trust it. This guide shows how to fix it properly for WordPress, WooCommerce, Laravel and Node.js.

Why default website email fails

Most hosting lets websites send mail using a basic built-in function (PHP's mail()). Those messages:

  • often lack proper SPF and DKIM authentication for your domain,
  • come from a shared server whose reputation you do not control,
  • leave no logs, so you cannot see whether they were delivered.

The result: contact-form messages and order confirmations land in spam or disappear. A dedicated sending service with a verified domain fixes all three problems.

How SMTP sending works

SMTP (Simple Mail Transfer Protocol) is the standard way email is sent. Your app connects to the sending service's SMTP server, logs in with your credentials, and hands over the message. The service signs it with your domain's DKIM key, sends it from servers listed in your SPF record, and records what happens to it.

Step 1: verify your sending domain

In your SiloLobby sending console, add the domain you send from, for example yourshop.com.ng. You receive DNS records to add:

Record Purpose
DKIM (3 CNAMEs) Signs every email as your domain
MAIL FROM (MX and TXT) Aligns the return path with your domain
SPF (TXT) Authorises the sending servers
DMARC (TXT) Sets your policy and reporting

If your domain is registered with SiloLobby, we can add them for you. Verification usually completes within minutes of the records being published.

Step 2: create SMTP credentials

Create an SMTP login (or an API key for HTTP sending). The password is shown only once, so store it in a password manager or your app's secure configuration. Create separate credentials for each website or app so you can revoke one without affecting the others.

Step 3: connect your app

WordPress and WooCommerce

Install a well-known SMTP plugin, then enter:

  • SMTP host: shown in your sending console
  • Port: 587 with TLS, or 465 with SSL
  • Authentication: on
  • Username and password: your SMTP credentials
  • From email: an address on your verified domain, such as orders@yourshop.com.ng
  • From name: your business name

Turn on "force From email" so plugins cannot send from unverified addresses. Then use the plugin's test feature.

Laravel

In your .env file:

MAIL_MAILER=smtp
MAIL_HOST=your-smtp-host
MAIL_PORT=587
MAIL_USERNAME=your-username
MAIL_PASSWORD=your-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=orders@yourshop.com.ng
MAIL_FROM_NAME="Your Shop"

Clear the configuration cache after editing, then send a test notification.

Node.js with Nodemailer

const nodemailer = require("nodemailer");

const transporter = nodemailer.createTransport({
  host: process.env.SMTP_HOST,
  port: 587,
  auth: { user: process.env.SMTP_USER, pass: process.env.SMTP_PASS },
});

await transporter.sendMail({
  from: "Your Shop <orders@yourshop.com.ng>",
  to: "customer@example.com",
  subject: "Order confirmed",
  text: "Thanks for your order! We will email you when it ships.",
});

Keep credentials in environment variables, never in your code repository.

Other apps and plugins

Almost any app that sends email has SMTP settings: CRMs, booking systems, helpdesks, invoicing software. Use the same host, port and credentials.

Step 4: test and check authentication

  1. Send a test to your own Gmail address.
  2. Open the email, choose Show original.
  3. Confirm SPF: PASS, DKIM: PASS and DMARC: PASS.

Your sending console also shows every email's status: delivered, bounced or complained.

Ports and encryption

Port Encryption When to use
587 STARTTLS Recommended default
465 SSL/TLS When your app expects "SSL"
25 None or STARTTLS Avoid; often blocked by networks

Start in test mode

New SiloLobby sending accounts start in test mode: you can send to your own address and to addresses on your verified domains, up to 100 emails a day, while you connect everything. When you are ready, request full access from the console. We check your website and how people sign up, then turn on full sending. New accounts also ramp up gradually over two weeks to build a good reputation.

Troubleshooting

Problem Likely cause Fix
Authentication failed Wrong username or password Recreate credentials and paste them carefully
Connection timed out Port blocked by your host or firewall Try port 587 or 465
"Sender not verified" From address is not on a verified domain Use an address on your verified domain
Emails in spam Missing DKIM or DMARC, or poor content Check records; review content and list
Gmail shows "via" DKIM not aligned with your domain Add the DKIM records from the console

Security tips for SMTP credentials

  • Store credentials in environment variables or your platform's secret storage, never in public code repositories.
  • Use separate credentials for each website or app.
  • Revoke credentials immediately if a developer leaves or a server is compromised.
  • Watch your sending logs for unexpected volume, which can indicate stolen credentials.

Monitoring your sending

Once everything is connected, check your sending console regularly:

  • Delivered: emails accepted by the recipient's server.
  • Bounced: addresses that do not exist or rejected the email; they are suppressed automatically so you stop sending to them.
  • Complaints: recipients who marked an email as spam. Investigate if these appear on transactional email.

A sudden rise in bounces often means a form is collecting mistyped addresses; adding email validation to the form helps.

Choosing your From address

Use a clear, consistent sender for each type of email:

Email type Example From address
Order confirmations and receipts orders@yourshop.com.ng
Password resets and codes security@yourshop.com.ng or no-reply@yourshop.com.ng
Contact form notifications website@yourshop.com.ng
Account notices accounts@yourshop.com.ng

Whichever you choose, the address must be on your verified domain. If you use a "no-reply" address, make sure the email tells customers how to reach you.

SMTP or HTTP API?

Both send the same emails. SMTP works with almost every plugin and framework out of the box. An HTTP API call is often simpler from custom code, can be faster, and returns a message ID immediately for your logs. Many teams use SMTP for off-the-shelf software and the API for their own applications. SiloLobby email sending supports both, with the same verified domains, logs and limits.

Summary

Send website and app email through a proper SMTP service: verify your domain, create credentials, enter the host and port in your app, and confirm SPF, DKIM and DMARC pass. Your contact forms, receipts and codes will arrive reliably, with logs to prove it.

See SMTP plans →

Frequently asked questions

Why are my WordPress emails not sending?

By default WordPress sends mail through the server's PHP mail function, which many inboxes distrust. Connecting an SMTP service with a verified domain fixes it.

What port should I use for SMTP?

Use port 587 with STARTTLS or port 465 with SSL. Avoid port 25, which many networks block.

Is there a free SMTP plan?

Yes. SiloLobby has a free transactional plan to get started, with paid plans from ₦32,000/month.

Should I use SMTP or an HTTP API?

SMTP works with almost any app and plugin. An HTTP API is often faster and gives richer responses for custom applications. SiloLobby supports both.

Why do my emails say 'via' another server in Gmail?

It usually means DKIM is not set up for your domain. Add the DKIM records from your sending console so emails are signed as your domain.

SiloLobby

Business email

you@yourbusiness.com.ng on every device, priced per mailbox.

See email plans
  • #smtp
  • #transactional-email
  • #wordpress
  • #developers

More business email guides

Send Email From Your Website or App With SMTP | SiloLobby