# nopCommerce email with Groundmail

Send nopCommerce store email through Groundmail by adding an email account that uses the Groundmail SMTP relay. Order confirmations, shipment and invoice notifications, customer registration and password recovery emails, and every other message template then go out from your own domain.

---

## Prerequisites

- A Groundmail account with a [verified sending domain](https://docs.groundmail.dev/domains).
- An SMTP credential: in the Groundmail dashboard, open **SMTP** and choose **Create SMTP credential**. The password (`gmsmtp_…`) is shown once, so copy it. See [SMTP relay](https://docs.groundmail.dev/smtp).
- Admin access to the nopCommerce store.

Everything the store sends through the relay goes out as transactional email, so use it for order, account and notification email. Send opt-in newsletters through the [API](https://docs.groundmail.dev/emails) with `category: "newsletter"` once your account is approved, and never send cold email.

---

## Add the email account

1. In the nopCommerce admin, go to **Configuration**, then **Email accounts**, and click **Add new**.
2. Fill in the account:

| nopCommerce field | Value |
|-------------------|-------|
| Email address | An address on your verified domain, for example `orders@yourdomain.com` |
| Email display name | Your store name |
| Host | `smtp.groundmail.dev` |
| Port | `587` |
| SSL | Off |
| Authentication method | Login/Password |
| User | `groundmail` |
| Password | Your SMTP credential (`gmsmtp_…`) |

3. Click **Save**.

Leave **SSL** unchecked. In nopCommerce, **SSL** means a TLS connection from the first byte (port 465). With it off, nopCommerce upgrades the connection on port 587 with STARTTLS, which is what the relay expects. Older nopCommerce versions show a **Use default credentials** checkbox instead of **Authentication method**: leave it unchecked and fill in the username and password.

### Use it for store email

nopCommerce sends each message template from the email account chosen on that template. Go to **Content management**, then **Message templates**, open the templates your store uses (for example `OrderPlaced.CustomerNotification` and `ShipmentSent.CustomerNotification`), and set **Email account** to the account you just added. If you have more than one email account, mark this one as the default in the **Email accounts** list so templates that don't choose an account use it too.

---

## Test it

Groundmail's simulator addresses work over SMTP and never reach a real inbox. Open the email account you added, enter this in **Send email to** and click **Send test email**:

```text
delivered@simulator.groundmail.dev
```

nopCommerce shows a success message when the server accepts the message. Then confirm in Groundmail: open **Emails** in the dashboard, or run:

```bash
curl "https://api.groundmail.dev/emails?limit=5" \
  -H "Authorization: Bearer $GROUNDMAIL_API_KEY"
```

The email appears with the status `delivered` and `"test": true`. Use `bounce@simulator.groundmail.dev` to see a hard bounce. The full list is in [Testing](https://docs.groundmail.dev/testing#simulator-addresses).

To test a real order email without emailing a customer, register a test customer with the email `delivered@simulator.groundmail.dev` and place an order. nopCommerce queues template emails and sends them from a scheduled task, so the email can take a minute to appear. The queued email and any send error show in the admin's message queue.

---

## Troubleshooting

**Authentication failed.** The username must be exactly `groundmail`, and the password must be the SMTP credential (`gmsmtp_…`), not an API key (`gm_…`). Check **Authentication method** is **Login/Password**.

**Connection timed out or the TLS handshake fails.** Check the host is `smtp.groundmail.dev`, the port is `587` and **SSL** is off. If your server blocks outbound port 587, use port `2525` with the same settings.

**The message is rejected because of the From address.** The account's **Email address** must use a [verified domain](https://docs.groundmail.dev/domains) on your account. Until then you can only send from the sandbox sender, and only to your own account email.

**Test email works but order emails don't arrive.** Check the template is active and its **Email account** is the Groundmail account, and look for send errors on the queued email in the admin's message queue.

**A recipient never receives the email.** The address may be on your suppression list, usually after a hard bounce. See [Suppressions](https://docs.groundmail.dev/suppressions), and create a [webhook](https://docs.groundmail.dev/webhooks) for `email.bounced` to get notified.

**Sends are deferred.** A new account has a daily ramp-up limit, and the Free plan has a daily limit. The relay replies with a temporary error and a retry time. See [Sending limits](https://docs.groundmail.dev/sending-limits).

---

## Related

- [SMTP relay](https://docs.groundmail.dev/smtp)
- [Testing](https://docs.groundmail.dev/testing)
- [Webhooks](https://docs.groundmail.dev/webhooks)
- [WordPress and WooCommerce](https://docs.groundmail.dev/integrations/wordpress)
