# From Name and From Address

## From Name vs From Address

The `from` field of an email contains **from name** and **from address**. This is illustrated in the image below:

![](https://4126954886-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAQH3DF49Lq0AJudrbF%2Fuploads%2Fgit-blob-ac0d5b16f4c321f9400f8e2ed84d245d624101e0%2Ffrom-name-and-address.png?alt=media)

If the `from` field in the JSON body of the API call is omitted:

1. The from name defaults to `Postman.gov.sg`
2. The from address defaults to `<donotreply@@mail.postman.gov.sg>`

## Changing From Name

In our API, the from name of an email can be changed by the API user by modifying the `from` field in the API call. For example, to use `New Product` as the from name, the API user could use the following JSON body:

```json
{
  "recipient": "zixiang@open.gov.sg",
  "subject": "Hello there",
  "body": "What's upppp",
  "from": "New Product <donotreply@mail.postman.gov.sg>"
}
```

The email recipient will see the following:

<figure><img src="https://4126954886-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAQH3DF49Lq0AJudrbF%2Fuploads%2Fd3coNMOyAF8d9vnCzPGM%2Fcustom-from-name.png?alt=media&#x26;token=338c7dfd-d06a-4ee6-8b7e-86522c87d429" alt="" width="375"><figcaption></figcaption></figure>

For users that wish to customise their emails without going through the hassle of setting up a [custom from address](https://postman-v1.guides.gov.sg/~/changes/YeLkNyuQOW0qmXU37t7T/email-api-guide/programmatic-email-api/custom-from-address), this is an intermediate solution used by our existing users.

## Using a Custom From Address

Users may wish to send emails using a custom from name as well as a custom from address (i.e. any email address that is not the default `<donotreply@mail.postman.gov.sg>`. Setting up a custom from address is necessary; for more information, [see here](https://postman-v1.guides.gov.sg/~/changes/YeLkNyuQOW0qmXU37t7T/email-api-guide/programmatic-email-api/custom-from-address).

{% hint style="info" %}
Create an account on Postman using the email address from which you wish to send your email.

For example, if you want your email to be sent from <mark style="color:red;">`no-reply@agency.gov.sg`</mark>, you should log into Postman using this email address and generate your API keys on the dashboard.
{% endhint %}

To make use of the custom from address, the JSON body of the API call is:

```json
{
  "recipient": "zixiang@open.gov.sg",
  "subject": "Hello there",
  "body": "What's upppp",
  "from": "New Product <donotreply@mail.postman.gov.sg>"
}
```

The recipient will see:

1. A custom from name `New Product`
2. A custom from address `<test_admin@postman.gov.sg>`

![](https://4126954886-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAQH3DF49Lq0AJudrbF%2Fuploads%2Fgit-blob-d67809253126eab267a2fa863e7ffafc48f1cb04%2Fcustom-domain.png?alt=media)
