Mail Server Configuration controls how Powercode sends outbound email, such as customer invoices, ticket replies, mass notifications and network monitoring alerts.
Your Powercode billing server comes with a basic internal email server. It's useful for testing and getting started. We recommend connecting a third-party mail server to relay your mail instead. The internal server has limited configuration options, and major email services scrutinize mail more closely than they used to (including new IPv6 formatting). Because of that, we can't guarantee the internal server will reach every recipient, even when nothing else is wrong.

Config > Mail Server Configuration
| Permission | Why it is needed |
|---|---|
| Outbound Email (System → Configuration) | To open the page, change the settings and send test emails. |
| Field | What it does |
|---|---|
| Sending Method | Internal Server sends through your Powercode billing server. Remote SMTP Server sends through another mail server. With Internal Server, the SMTP fields below are hidden. |
| SMTP Server | The hostname or IP address of your mail server. |
| SMTP Client Hostname (EHLO) | The hostname Powercode gives the mail server when it connects. Leave it blank to use the billing server's own hostname. See SMTP Client Hostname (EHLO) below. |
| SMTP Port | The port your mail provider tells you to use. The help text notes this is usually 25. |
| SMTP Encryption | None, SSL or TLS, whichever your mail provider supports. |
| SMTP Authentication | How Powercode signs in to the mail server: No, Username / Password or O365 - OAuth. See SMTP Authentication below. |
| SMTP Username | The username for your mail server. It may not be the same as the email address, even if you can sign in with both. |
| SMTP Password | The password for your mail server. The saved password shows as asterisks. Leave them as they are to keep it. |
| Email Batch Size | The most emails Powercode sends in one batch. 0 means no limit. |
| Email Batch Time | The number of seconds each batch takes at minimum. See Email Batch Size and Email Batch Time below. |
Click Save to keep your changes.
| Option | Use it when | Fields shown |
|---|---|---|
| No | Your mail server accepts mail from the billing server without a username or password. | None |
| Username / Password | Your mail server needs a username and password. | SMTP Username, SMTP Password |
| O365 - OAuth | You send through a Microsoft 365 mailbox using OAuth. | SMTP Username, SMTP Password, Client ID, Client Secret, Directory (tenant) ID, Scope |
With O365 - OAuth, Powercode gets a sign-in token from Microsoft and uses it to send mail:
https://outlook.office.com/SMTP.Send openid offline_access. Leave it at the default. In this build, a changed value isn't saved.Each time you save the page, Powercode throws away its stored Microsoft token and signs in again with the new values on the next email.
When Powercode connects to a remote mail server, it introduces itself with a hostname. This is the EHLO command. Normally that's the billing server's operating-system hostname.
Set SMTP Client Hostname (EHLO) when your mail provider rejects or flags that name. This can happen when the server's hostname is a short or internal name rather than a full domain name. Enter the server's full public name, such as billing.yourdomain.com. Leave it blank if mail is going through fine.
This setting only applies when Sending Method is Remote SMTP Server.
Use these if your mail provider limits how many messages you can send in a period of time.
For example, Email Batch Size 30 and Email Batch Time 60 sends no more than 30 emails a minute. Email Batch Time has no effect while Email Batch Size is 0.
The Test Email section sends a test message through your mail settings. Click Save first, because the test always uses the saved settings, not what's typed on the page.
The test email's subject is "Test Email from Powercode". If it's sent, you see "Mail sent successfully, please check your inbox." If it fails, you see the error from the mail server and a Log Mail Send box with the conversation between Powercode and the server. That log is useful when you're working with your mail provider.
| Symptom | Likely cause |
|---|---|
| The test fails with O365 - OAuth selected | Microsoft refused the sign-in. The error shown comes from Microsoft. Check the mailbox username and password, and the Client ID, Client Secret and Directory (tenant) ID. MS OAuth Unknown Error means Microsoft gave no reason. |
| The mail server rejects the connection or flags the server's name | Set SMTP Client Hostname (EHLO) to the billing server's full public hostname. |
| The mail provider complains about too many messages | Set Email Batch Size and Email Batch Time to stay under its limit. |
| The test fails because of the sender | The mail server isn't allowed to send from the From Address. Use an address on your own domain. |