Quick BB
PHP 8.2+ & MySQL Buy license · $79.95
Setting up

How to Set Up Forum Email With SMTP

Make forum emails reach the inbox: set up SMTP, choose port 465 or 587, send a test email and add SPF, DKIM and DMARC records to your domain.

Updated 5 minute read The Quick BB team

Your forum depends on email more than you might think. Registration verification, password resets and watched thread notifications all go out by email, and if those messages land in spam or never arrive, new members give up. This guide explains why SMTP is the reliable choice, how to set it up and how to add SPF, DKIM and DMARC so your mail gets delivered.

Why SMTP instead of basic PHP mail

Out of the box, many PHP applications send mail through the server's built-in mail function. It is easy, but it has real problems on shared hosting:

  • Messages are often sent from a generic server address rather than your domain, so receiving servers have less reason to trust them.
  • There is no login involved, so the message carries little proof that you are allowed to send for your domain.
  • Errors are hard to see. A failed message often just disappears.

SMTP sends mail by logging in to a real mail server with a username and password, just like an email program does. Mail goes out from a mailbox on your own domain, and you get clear error messages when something is wrong. Quick BB includes SMTP settings with a test email button, so you can confirm it works before members rely on it.

Step 1: Create a mailbox for the forum

In your hosting control panel, create an email account on your forum's domain. Common choices are noreply@example.com or forum@example.com.

  • Use a strong, unique password. This mailbox will be stored in the forum's settings.
  • Use the same domain as the forum. Sending from a free webmail address on a different domain is a common cause of mail being rejected.
  • Consider using an address that can receive replies, such as forum@. Some members will reply to notifications, and it is useful to see those messages.

If your host does not offer email, or limits how many messages you can send per hour, a transactional email service is the alternative. It gives you SMTP details in the same way.

Step 2: Find your SMTP details

Your host or email provider will list these in the mailbox settings, often under "Connect devices" or "Mail client setup":

SettingTypical value
SMTP hostmail.example.com or a host name given by your provider
Port465 (implicit TLS) or 587 (STARTTLS)
EncryptionTLS/SSL for port 465, STARTTLS for port 587
UsernameUsually the full email address
PasswordThe mailbox password
From addressThe same mailbox address

Which port should you use?

Ports 465 and 587 are both for sending mail from an application to your mail server, and both require you to log in. On port 465 the connection is encrypted from the first byte. On port 587 it starts unencrypted and then upgrades with STARTTLS. The current standard for mail submission (RFC 8314) prefers implicit TLS on port 465, but either works if your provider supports it. Avoid port 25: it is meant for server-to-server delivery, and many hosting and cloud providers block outgoing connections on it.

Step 3: Enter the settings and send a test

  1. Log in to the Admin CP and open the email settings.
  2. Choose SMTP and enter the host, port, encryption, username and password.
  3. Set the From address to your forum mailbox, and the From name to your forum's name.
  4. Save, then use the test email button to send a message to an address you check.
  5. Check the inbox and the spam folder. Try at least two different email providers if you can.

If the test fails, the error message usually points to the cause. "Authentication failed" means a wrong username or password. A timeout usually means the wrong port or that the port is blocked. A certificate error usually means the host name does not match the server's certificate, so try the exact host name your provider lists.

Step 4: Add SPF, DKIM and DMARC

Getting mail sent is half the job. Getting it into the inbox depends on email authentication, which is set up with TXT records in your domain's DNS. Major mailbox providers now require at least SPF or DKIM from all senders, and stricter rules apply to high-volume senders.

SPF

An SPF record lists which servers are allowed to send mail for your domain. It lives as a TXT record on the domain itself and looks something like v=spf1 include:_spf.yourprovider.example ~all. Your host or mail provider will tell you what to include. Two important points:

  • Have only one SPF record per domain. If you use several services, combine them into one record. Two separate SPF records cause SPF to fail.
  • SPF allows at most 10 DNS lookups, and each include: counts. Going over the limit breaks SPF.

DKIM

DKIM adds a digital signature to each message, proving it was sent with your domain's permission and was not changed on the way. Your mail provider signs the mail with a private key, and you publish the matching public key as a TXT record at an address like selector._domainkey.example.com. Many hosts can set this up automatically from the control panel.

DMARC

DMARC ties SPF and DKIM to the From address members actually see, and tells receiving servers what to do with mail that fails. It is a TXT record at _dmarc.example.com. There are three policies:

  • p=none: deliver failing mail but send reports. Start here.
  • p=quarantine: treat failing mail as suspicious, usually sending it to spam.
  • p=reject: refuse failing mail.

A simple starting record is v=DMARC1; p=none; rua=mailto:dmarc@example.com. Once reports show that your legitimate mail passes, move to quarantine and then reject.

Step 5: Customize the email templates

Quick BB includes email templates for messages such as registration and password resets. Spend a few minutes on them:

  • Use your forum's name in the subject line so members recognize it.
  • Keep messages short and to the point, with one clear link.
  • Avoid spammy wording, all capitals and lots of links.
  • Say why the member is receiving the email, for example "You asked to reset your password".

Keeping email healthy

Email delivery is not set-and-forget. A few habits help:

  • Keep spam registrations out. Fake accounts with fake addresses cause bounces, and lots of bounces hurt your sending reputation. Quick BB's anti-spam features, including CAPTCHA and email verification, are on by default. See stop forum spam registrations.
  • Offer digests. Members who follow many threads can choose daily or weekly digests instead of instant emails, which cuts volume a lot.
  • Watch your host's sending limits. Many shared hosts limit messages per hour. If your forum grows past that, move to a dedicated email service.
  • Re-test after changes. Send a test email whenever you change hosts, passwords or DNS.

Email also matters for account security, since password reset links go to the member's inbox. Read the forum security checklist next, or see the Quick BB features for the full list of email, security and anti-spam tools.

Frequently asked questions

Should I use port 465 or 587 for SMTP?

Both are for authenticated mail submission. Port 465 uses implicit TLS and is preferred by RFC 8314, while 587 uses STARTTLS. Use whichever your provider supports, and avoid port 25.

Why are my forum emails going to spam?

The most common causes are sending through basic PHP mail, a From address on a different domain, or missing SPF, DKIM and DMARC records. Switch to SMTP on your own domain and add those records.

Can I have more than one SPF record?

No. A domain should have only one SPF record. If you use several sending services, combine them into a single record.

Get three guides like this every month, plus software update notices.Subscribe →