Contact form not sending? Make PHP and WordPress mail work on BrewInTH

PHP's mail() and WordPress now send through your project's mailbox: create one, press Use in the app, publish again. No code changes, no SMTP plugin.
You moved a PHP or WordPress site over and every page opens. Then a customer fills in your contact form, and the site says the message could not be sent, even though it may well have been saved. WordPress password-reset emails never arrive either. Your code isn't the problem. Code written for ordinary web hosting sends email with PHP's mail() function, which needs a mail program on the server.
Since 22 October 2026, mail() on BrewInTH can send through your project's mailbox: connect the mailbox to the app once, with no code changes and no SMTP plugin. This guide covers what you need, the four steps to set it up, what the email looks like when it arrives, and where to look if it still doesn't go out.
In short
✉️ Since 22 October 2026, PHP'smail()and every WordPress email can go out through your project's mailbox
🌐 You need your own verified domain and a mailbox for the site to send from, such asnoreply@
🔌 Press Use in the app on that mailbox, then publish again; not a line of code changes
↩️ The sender is always your mailbox and the visitor's address goes to Reply-To, so you can simply press Reply
🔎 Still silent? Look for a line startingbrewInTH sendmail:on the Logs tab
Why mail() used to fail, and how it works now
On a typical cPanel host, mail() hands the message to the server's sendmail program, which delivers it over port 25. The servers that run sites on BrewInTH have no such program, and outbound port 25 is closed. Before 22 October 2026, mail() therefore returned false every time, and a form that checks that value told the visitor it had failed.
Now the PHP configuration (php.ini) that BrewInTH gives every PHP site points mail() at the platform's own sending program. That program signs in to the mailbox you connected and sends through the BrewInTH mail server on port 587, encrypted, using the MAIL_* values on the project's App settings tab. Code written for a host with sendmail keeps working the moment a mailbox is connected. It works for the site itself and for the Commands and Schedules tabs of a PHP project.

Along the way, everyone in To, Cc and Bcc receives the message with the Bcc line removed, text such as Thai without a declared character set is labelled UTF-8, and one email may be up to 30 MB, attachments included.
Before you start: what you need
- A PHP or WordPress site that sends with
mail(). Most hand-written forms do, and so does WordPress. If the site went up through the Upload & go live page, its What the platform did summary already told you to create a mailbox and press Use in the app. - Your own verified domain. The Free package can't use your own domain and has no mailboxes. Every paid package can, for example Starter at ฿99 a month with 3 mailboxes of 100 MB each (prices at the time of writing; see Which BrewInTH plan should you choose?).
- A mailbox for the site to send from. Use a separate one such as
noreply@, because connecting it to the app gives it a new password. - Complete mail DNS records: MX, SPF, DKIM and DMARC at your domain's DNS provider. Without them, mail to Gmail or Outlook tends to land in spam or bounce. For a domain registered through BrewInTH, the team sets them for you, usually within a day.
Make the form send in four steps

1. Check that your domain is verified
Open the project and go to the Domains tab: your domain should have passed its DNS check. If you haven't connected it yet, follow Your own domain on BrewInTH first. Meanwhile the site keeps working on its BrewInTH address, but you can't create a mailbox yet.
2. Create a mailbox for the site to send from
On the project's Email tab, type a Mailbox name such as noreply, pick the Domain and press Add mailbox. The initial password is shown once; you won't need it here, because the next step sets a new one. Wait until the mailbox shows Active.
If this domain has no mail DNS records yet, add the ones listed under Mail DNS records at the bottom of the page, at your domain's DNS provider. That's once per domain. Each record is explained in Email on your own domain, and sending mail from your app.
3. Press "Use in the app" on that mailbox
On the noreply@ row, press Use in the app, whose full label ends in “(write MAIL_*)”. The page explains that the mailbox gets a new password and that seven values are written into the project's app settings: MAIL_MAILER, MAIL_HOST, MAIL_PORT, MAIL_ENCRYPTION, MAIL_USERNAME, MAIL_PASSWORD and MAIL_FROM_ADDRESS. Press Confirm and write, and the mailbox gets the tag Used by the app.
The button sets a new password every time, and the mailbox's old password stops working. Don't use it on a mailbox you read in Webmail or on your phone. Give the site a mailbox of its own.
4. Publish again, then try the form
The app loads its settings when it is released; restarting it doesn't load new values. Open the Releases tab, check that Source archive (.zip) shows your latest files, and press Build & publish. If an AI put the site online, you can simply ask it to deploy again. Once the new release shows Active, send the form from the live site.
If you pressed Use in the app and published again before 22 October 2026, there's nothing more to do: every PHP site received the new configuration that day. Just try the form.
What the email looks like
Most form code puts the visitor's address in From, so that replying is easy. Sent out like that, though, Gmail and Outlook tend to treat it as a forged sender and drop it in spam or refuse it. So BrewInTH arranges it this way:
- From is the connected mailbox, for example
noreply@maneebakery.com. The display name is the name the form gave along with the visitor's address, say Somchai. - Reply-To is the visitor's address, so Reply reaches your customer straight away. If the code sets its own Reply-To, that one is kept.
- A From on the mailbox's own domain, such as
contact@maneebakery.com, stays exactly as the code wrote it.
Would you rather see your shop's name than the visitor's? On the App settings tab, enter MAIL_FROM_NAME as the Name and your shop's name, say Manee Bakery, as the Value, press Save and publish again. Thai names work too. To send from a different mailbox, press Use in the app on that mailbox instead.
WordPress: no SMTP plugin needed any more
WordPress sends every email through wp_mail(), which uses PHP's mail() underneath: password resets, notices to the site's admin, and forms from plugins such as Contact Form 7 or WPForms. Once the four steps above are done, all of them go out. If you read that WordPress on BrewInTH needs an SMTP plugin, that hasn't been true since 22 October 2026.
- An SMTP plugin carried over from your old host, such as WP Mail SMTP pointed at the old host's mail server, sends through those settings instead of
mail(). Once the old host is gone, nothing goes out. Deactivate the plugin in wp-admin, or change its settings to your BrewInTH mailbox. - The From field of your form plugin: set it to the connected mailbox, for example
noreply@maneebakery.com, and put the visitor's address in the Reply-To field if the plugin has one.
Haven't moved your WordPress site yet? Start with Move a WordPress site to BrewInTH with a ZIP and a .sql file.
Test that the email really arrives
- Fill in the form on the live site with your own personal address, Gmail for example.
- Open the mailbox the form sends to. For a BrewInTH mailbox, press Open Webmail on the Email tab, and check that the message arrived and isn't in spam.
- Press Reply: the recipient should be the address you typed into the form.
- If the form sends to an address whose mail isn't hosted on BrewInTH, such as Gmail, the line Sent to … recipients on other domains today under the mailbox's name goes up.
mail() returning true means the BrewInTH mail server accepted the message, not that it reached its destination. When a message can't be delivered, the bounce comes back to the sending mailbox, so open Webmail for noreply@ to read why. Its password is the MAIL_PASSWORD value on the App settings tab.
Not sending? Read the reason on the Logs tab
When sending fails, mail() returns false and the reason goes into the app's log. Open the Logs tab, press Fetch logs and look for lines starting brewInTH sendmail:.

MAIL_HOST is not set: no mailbox is connected to the app yet; do steps 3 and 4. If you already pressed Use in the app and still see it, the project hasn't been published since (a restart isn't enough).the login of … refused by the mail server: the password in the app settings no longer matches the mailbox, usually because someone changed it. Press the mailbox's button again (it now reads Rewrite the app'sMAIL_*), or change the password under Password / quota / delete with Update the app's settings too ticked, then publish again.daily limit … reached: the mailbox has sent to as many recipients on other domains today as the package allows; it can send again after midnight Thai time.sending to other domains is paused: sending to other domains was stopped because of unusual bounces or spam reports, though the mailbox still receives mail. Check the form and its recipients, then ask the team to resume sending.- Sent, but it never arrives or lands in spam: the mail DNS records are incomplete. Check MX, SPF, DKIM and DMARC against the list on the Email tab, and copy the SPF value exactly.
- No
brewInTH sendmailline at all: the code may not usemail(), for example PHPMailer in SMTP mode set up for the old host, or the form fails before it gets to sending. Copy the log to your AI.
The daily limit, and keeping bots from getting your mailbox paused
Each mailbox may send to a set number of recipients on other domains per day, depending on the package. At the time of writing that is 300 a day on Starter, Starter Plus and Seed, and 500 on Maker, Growth and Pro, and the count restarts at midnight Thai time. Recipients on domains whose mail BrewInTH hosts don't count, so a form that sends to contact@maneebakery.com, itself a BrewInTH mailbox, uses none of it, while a form that sends to your Gmail counts one recipient per message.
These mailboxes are meant for a site's own notifications, not newsletters or bulk marketing, which belong with a service such as Mailchimp or Brevo.
Public forms attract spam bots. The riskiest kind of form emails a confirmation back to whatever address was typed in: bots fill in made-up addresses by the hundred, bounces pile up, and the mailbox gets paused for other domains. Before you open the form to everyone, send this to your AI in your usual chat and fill in the blank:
The contact form of my PHP site on BrewInTH sends email with mail() through a connected mailbox (the MAIL_* values are in the app settings).
Please check and fix the form files as follows:
- Send to ________ (the address I actually read)
- Validate the visitor's email with filter_var and FILTER_VALIDATE_EMAIL, and strip line breaks from the name and subject before they go into a header
- Use getenv('MAIL_FROM_ADDRESS') as From and put the visitor's email in Reply-To
- Encode a Thai subject with mb_encode_mimeheader and send Content-Type: text/plain; charset=UTF-8
- Add a hidden honeypot field against bots, and stop the same visitor from submitting again and again in quick succession
- Never send an automatic reply to the address the visitor typed in
- Tell the visitor it worked only when mail() returns true; otherwise ask them to try again and write the reason to error_log
- Keep the mail password out of the code, and don't add a mail library
- When you're done, tell me how to put the site online again
For the security of the form and the rest of the site, see Is an AI-built website safe? A 10-point checklist before launch.
FAQ
Do I have to change my form's code?
No, as long as it sends with mail() or uses PHPMailer's isMail() or isSendmail(), which end up in the same program. If the code uses PHPMailer or another library in SMTP mode with the old host's settings written in, ask your AI to read the MAIL_* values instead.
Does this work on the Free package?
The Free package can't use your own domain, so it has no BrewInTH mailbox, and mail() returns false. If you have another email service that accepts SMTP on port 587 or 465, you can enter MAIL_HOST, MAIL_PORT, MAIL_USERNAME, MAIL_PASSWORD and MAIL_FROM_ADDRESS yourself on the App settings tab and publish again; mail() then sends through that service.
What about Laravel, Node.js or Python sites?
Laravel reads the values that Use in the app writes right away, because they use Laravel's own names. Node.js and Python have no mail(), but they can send through the same mailbox: ask your AI to use Nodemailer or smtplib with these values. There's a ready-made prompt in Email on your own domain, and sending mail from your app.
My site is plain HTML. Can its form send email?
mail() only works on sites that run PHP, so a plain HTML site first needs a small PHP file to receive the form. If the site went up through the Upload & go live page, ask your AI to add a file such as contact.php and send the new ZIP to the same project: the platform turns the site into a PHP site by itself. See No coding agent? Upload a ZIP or paste code from a chat AI and go live.
Summary
Contact forms and WordPress emails on BrewInTH send with the same old mail(). All it takes is a verified domain, a mailbox for sending, one press of Use in the app and a new release. If nothing goes out, the reason is on the Logs tab, and before you open the form to the world, have your AI add protection against bots. For real screenshots of creating a mailbox, open User guide › Email at your own domain in the console.
Open the Email page in the console →
