# Configure WHMCS to send over SMTP
Source: https://docs.webgee.com/en/reseller/configuring-whmcs-to-use-smtp-for-mail







Make WHMCS send email through an authenticated mailbox. Applies to reseller
accounts running WHMCS.

WHMCS's default PHP mail sends unauthenticated messages that fail SPF and DKIM
checks — so invoices, password resets and ticket replies land in spam or vanish.
For a billing system that is a business problem, not an inconvenience.

## Before you begin [#before-you-begin]

Create a mailbox **on the domain WHMCS sends from** — `billing@example.com`.
A Gmail or Outlook address will not work: the sending domain must match the
authenticated account.

## Configure it [#configure-it]

1. In WHMCS, go to **Configuration → System Settings → General Settings →
   Mail**.

2. Beside **Mail Provider**, select **Configure Mail Provider**.

   <img alt="The Mail settings in WHMCS" src="__img0" />

3. Choose **SMTP** and enter:

   | Field         | Value                  |
   | ------------- | ---------------------- |
   | SMTP Host     | `mail.webgee.com`      |
   | SMTP Port     | `465`                  |
   | SMTP SSL Type | `SSL`                  |
   | SMTP Username | The full email address |
   | SMTP Password | The mailbox password   |

   <img alt="Entering the SMTP settings" src="__img1" />

4. Save.

<Callout type="warn">
  **Port and SSL type must match.** Port `465` requires `SSL`; port `587`
  requires `TLS`. Mixing them — `465` with `TLS`, or `587` with `SSL` — is the
  single most common cause of WHMCS failing to send, and the error it gives is
  not specific.
</Callout>

Full settings are in [Email server settings](/en/email/manual-configuration).

## Check it worked [#check-it-worked]

WHMCS has a test under **Utilities → System → System Email Log**, or send
yourself a test from a client profile.

Then check the message arrived in the inbox rather than spam. Delivery and
inbox placement are different tests.

## If mail still fails [#if-mail-still-fails]

* **`SMTP connect() failed`** — port and SSL type mismatch, per above. Try `587`
  with `TLS`.
* **Authentication failed** — the username must be the **full email address**.
* **Sends but lands in spam** — the From address does not match the
  authenticated domain, or your SPF record is wrong. See
  [SPF records for WebGee hosting](/en/email/what-are-the-correct-spf-records-when-using-webgee-hosting).
* **Mail stops after a while** — you may be hitting
  [sending limits](/en/email/email-sending-limits). A busy WHMCS sends a lot.

## Related [#related]

* [Email server settings](/en/email/manual-configuration)
* [Why are my emails being marked as spam?](/en/email/why-are-my-emails-being-marked-as-spam)
