# Contact form emails: how to set From and Reply-To

> Keep the visitor's address out of your form's sender field. Set From, To and Reply-To, try a Mailcore Email API request and verify where the manager's reply goes.

Canonical: https://mailcore.uz/en/blog/pisma-s-formy-sayta-from-reply-to/
Language: en-UZ
Author: Mailcore Editorial Team (https://mailcore.uz/en/blog/authors/)
Published: 2026-10-29
Updated: 2026-10-29

**A website form notification should use an authorised project address as its sender, your team's business address as its recipient, and the visitor's validated address in `Reply-To`.** The site can then send from its own domain while the team replies to the person who submitted the enquiry.

If form emails are not arriving, check this arrangement and the actual server-side sending result first. A browser's “Thank you” message does not confirm delivery. This guide is for a web agency or developer connecting notifications for a client. If you use a plugin, check its method of connecting to Mailcore separately.

## One notification has three different addresses

Suppose a visitor leaves an email address and a question. The site needs to notify the sales team. In that message:

- **`From` is the site's sender.** For example, `forms@notify.company.example`, configured in the sending project beforehand. It does not change whenever someone enters another address in the form.
- **`To` is the notification recipient.** For example, `sales@company.example`, chosen by the website client.
- **`Reply-To` is the reply destination.** Use the visitor's validated address here so the mail application's Reply action opens a message to that person.

All example addresses are illustrative. Use your own authorised sender and agreed mailboxes for a real integration.

Putting the visitor's address in `From` makes the site present itself as a sender from someone else's domain. It does not automatically have permission to send for that domain. Contact Form 7 flags this as a configuration issue, and its author recommends `Reply-To` for replying to the visitor.

`Reply-To` does not replace domain verification or repair SPF, DKIM or DMARC. Configure the sender and authentication separately using the [SPF, DKIM and DMARC guide](https://mailcore.uz/en/blog/spf-dkim-dmarc/). Those settings do not guarantee inbox placement.

## Test sending without the form first

Start with a minimal notification whose three addresses are known. For Mailcore, save this JSON as `form-message.json`:

```json
{
  "from": "forms@notify.company.example",
  "to": "sales@company.example",
  "replyTo": "visitor@recipient.example",
  "subject": "Website enquiry form_1042",
  "text": "Test form submission. Please contact me about setup.",
  "tags": {
    "form_id": "contact",
    "submission_id": "form_1042"
  }
}
```

This is synthetic test content, not customer data. Replace the addresses and associate the example with a separate controlled submission before running it. `from` must match an active sender in your project. If you also supply a display name, it must match the configured sender name; the example omits it.

Run the request on the server. Set `MAILCORE_API_KEY` to a server key for the transactional stream. Set `MAILCORE_FORM_EVENT_KEY` to the key persisted with this controlled submission before its first sending attempt. It must contain 16–128 ASCII characters: `A–Z`, `a–z`, `0–9`, dots, underscores, colons or hyphens.

```sh
curl --silent --show-error --fail-with-body \
  --connect-timeout 10 --max-time 30 \
  https://mailcore.uz/api/email/v1/streams/transactional/emails \
  -H "Authorization: Bearer ${MAILCORE_API_KEY}" \
  -H "Idempotency-Key: ${MAILCORE_FORM_EVENT_KEY}" \
  -H 'Content-Type: application/json' \
  --data-binary @form-message.json
```

Keep the key out of HTML, page JavaScript and visitor-facing messages. A test key checks the integration without real delivery. To verify receipt in a mailbox, arrange a live-mode test with real addresses you control.

Save the HTTP status, the `id` from a successful response and its association with `submission_id`. Once the API has accepted the message, follow [the guide to delivery checks after Email API returns 202](https://mailcore.uz/en/blog/email-api-202-status-dostavki/). Do not create another send merely because the message is not visible. That guide also covers retries and uncertain results. Check request fields and limits in the [current Email API documentation](https://mailcore.uz/en/docs/email-api/).

## If the request works, inspect the form handler

Make one controlled submission through the actual form and locate the same enquiry in the application. Confirm that the handler produces the same authorised `from`, a fixed business `to`, and a valid `replyTo` from the email field.

For a team notification, the server configuration determines the recipient. Do not let a visitor arbitrarily replace `to` or `from`. Validate the reply address as one email address, limit field lengths and avoid building mail headers by concatenating unchecked strings. Escape form content when inserting it into HTML. The `text` field is enough for the initial test.

The application needs protection against automated form abuse and request-rate limits. Email API limits do not replace that work. Treat an automatic reply to the visitor, if required, as a separate notification. Do not turn the form into a way to send arbitrary content to arbitrary addresses.

Also check what the success message means. If the site says “Enquiry saved”, the application must actually store it independently of the notification. If sending fails, the saved enquiry should remain accessible to the responsible person, with the problem visible in the working process. Mailcore handles email sending; enquiry storage, CRM and form-confirmation logic belong to your application.

For WordPress, establish whether the form uses `wp_mail()`, configured SMTP or a direct API. Connecting Email API does not automatically reconfigure an existing plugin. The official WordPress reference explicitly states that `true` from `wp_mail()` indicates successful processing, rather than confirmed receipt by the recipient.

> **Connecting form notifications for a client?** [Start connecting Mailcore Email API](https://mailcore.uz/onboarding/account/?mode=register&product=api&lang=en). Prepare the sender domain, business recipient address and submission-handling plan. See the [Email API product page](https://mailcore.uz/en/email-api/) for capabilities and the connection path.

## Acceptance includes the reply to the visitor

Use addresses you control for these checks:

1. Submit the form with a unique reference in the test text. Use it to find the enquiry record and API request result.
2. Open the actual notification in the business mailbox. Check the sender address and that the content matches the submission.
3. Select Reply without sending immediately. The recipient field should contain the visitor's controlled test address. After checking it, send the reply and confirm receipt.
4. In a test environment, try substituting an unrelated `From`. The handler should reject the substitution; Mailcore also checks that the sender is authorised. The application must handle the error instead of reporting delivery.
5. Simulate sending being unavailable. Confirm that the enquiry remains in the agreed working process and the responsible person can see the problem.

An API request alone or a polished form alone tests part of the integration. A complete result means the enquiry is recorded, the notification is found, and the manager's reply reaches the right person. Submission references and technical IDs help verify that without exposing correspondence or API keys in shared logs.

## Sources

- [Contact Form 7: sender domain and Reply-To](https://contactform7.com/configuration-validator-faq/).
- [Contact Form 7: sender address outside the site domain](https://contactform7.com/configuration-errors/email-not-in-site-domain/).
- [WordPress: wp_mail() reference](https://developer.wordpress.org/reference/functions/wp_mail/).
- [RFC 5322, section 3.6.2: From and Reply-To](https://www.rfc-editor.org/rfc/rfc5322.html#section-3.6.2).
