> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# NSPreviewMailingHeader

## Constructors

### NSPreviewMailingHeader()

```crmscript theme={null}
NSPreviewMailingHeader
```

## Methods

## GetDocumentMessageId()

```crmscript theme={null}
Integer GetDocumentMessageId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - If a document was used as the message this is the document ID.

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
Integer documentMessageId = thing.GetDocumentMessageId();
```

## GetFromAddress()

```crmscript theme={null}
String GetFromAddress()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Email address to put in the From header of the messages.

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
String fromAddress = thing.GetFromAddress();
```

## GetMessageId()

```crmscript theme={null}
Integer GetMessageId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Primary key.

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
Integer messageId = thing.GetMessageId();
```

## GetMessageSubject()

```crmscript theme={null}
String GetMessageSubject()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The mail subject field of the message.

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
String messageSubject = thing.GetMessageSubject();
```

## GetNumBounced()

```crmscript theme={null}
Integer GetNumBounced()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Number of recipients that resulted in a bounce.

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
Integer numBounced = thing.GetNumBounced();
```

## GetNumClicks()

```crmscript theme={null}
Integer GetNumClicks()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Number of recipients that clicked at least 1 link in the mailing.

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
Integer numClicks = thing.GetNumClicks();
```

## GetNumOpened()

```crmscript theme={null}
Integer GetNumOpened()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Number of recipients that opened the email.

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
Integer numOpened = thing.GetNumOpened();
```

## GetNumSent()

```crmscript theme={null}
Integer GetNumSent()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Number of emails sent at the current time.

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
Integer numSent = thing.GetNumSent();
```

## GetPersonFullName()

Gets the persons full name (internal name used in clients for employees).

```crmscript theme={null}
String GetPersonFullName()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String)

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
String personFullName = thing.GetPersonFullName();
```

## GetPersonId()

```crmscript theme={null}
Integer GetPersonId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Primary key.

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
Integer personId = thing.GetPersonId();
```

## GetShipmentDescription()

```crmscript theme={null}
String GetShipmentDescription()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Describes the shipment.

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
String shipmentDescription = thing.GetShipmentDescription();
```

## GetShipmentId()

```crmscript theme={null}
Integer GetShipmentId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Primary key.

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
Integer shipmentId = thing.GetShipmentId();
```

## GetShipmentType()

```crmscript theme={null}
String GetShipmentType()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The list item.

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
String shipmentType = thing.GetShipmentType();
```

## GetStartDate()

```crmscript theme={null}
DateTime GetStartDate()
```

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - The date and time when to start this shipment.

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
DateTime startDate = thing.GetStartDate();
```

## GetStatus()

```crmscript theme={null}
Integer GetStatus()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Sending/stopped/failed etc. See \<xref href="CRMScript.NetServer.ShipmentStatus" data-throw-if-not-resolved="false">\</xref>.

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
Integer status = thing.GetStatus();
```

## SetDocumentMessageId(Integer)

```crmscript theme={null}
Void SetDocumentMessageId(Integer documentMessageId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
Integer documentMessageId;
thing.SetDocumentMessageId(documentMessageId);
```

## SetFromAddress(String)

```crmscript theme={null}
Void SetFromAddress(String fromAddress)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
String fromAddress;
thing.SetFromAddress(fromAddress);
```

## SetMessageId(Integer)

```crmscript theme={null}
Void SetMessageId(Integer messageId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
Integer messageId;
thing.SetMessageId(messageId);
```

## SetMessageSubject(String)

```crmscript theme={null}
Void SetMessageSubject(String messageSubject)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
String messageSubject;
thing.SetMessageSubject(messageSubject);
```

## SetNumBounced(Integer)

```crmscript theme={null}
Void SetNumBounced(Integer numBounced)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
Integer numBounced;
thing.SetNumBounced(numBounced);
```

## SetNumClicks(Integer)

```crmscript theme={null}
Void SetNumClicks(Integer numClicks)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
Integer numClicks;
thing.SetNumClicks(numClicks);
```

## SetNumOpened(Integer)

```crmscript theme={null}
Void SetNumOpened(Integer numOpened)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
Integer numOpened;
thing.SetNumOpened(numOpened);
```

## SetNumSent(Integer)

```crmscript theme={null}
Void SetNumSent(Integer numSent)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
Integer numSent;
thing.SetNumSent(numSent);
```

## SetPersonFullName(String)

Gets the persons full name (internal name used in clients for employees).

```crmscript theme={null}
Void SetPersonFullName(String personFullName)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
String personFullName;
thing.SetPersonFullName(personFullName);
```

## SetPersonId(Integer)

```crmscript theme={null}
Void SetPersonId(Integer personId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
Integer personId;
thing.SetPersonId(personId);
```

## SetShipmentDescription(String)

```crmscript theme={null}
Void SetShipmentDescription(String shipmentDescription)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
String shipmentDescription;
thing.SetShipmentDescription(shipmentDescription);
```

## SetShipmentId(Integer)

```crmscript theme={null}
Void SetShipmentId(Integer shipmentId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
Integer shipmentId;
thing.SetShipmentId(shipmentId);
```

## SetShipmentType(String)

```crmscript theme={null}
Void SetShipmentType(String shipmentType)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
String shipmentType;
thing.SetShipmentType(shipmentType);
```

## SetStartDate(DateTime)

```crmscript theme={null}
Void SetStartDate(DateTime startDate)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
DateTime startDate;
thing.SetStartDate(startDate);
```

## SetStatus(Integer)

```crmscript theme={null}
Void SetStatus(Integer status)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPreviewMailingHeader thing;
Integer status;
thing.SetStatus(status);
```


## Related topics

- [NSMarketingAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSMarketingAgent.md)
- [Get Preview Mailing Header](/en/api/reference/restful/agent/marketing_agent/get-preview-mailing-header.md)
- [SuperOffice.WebApi.Data.PreviewMailingHeader](/en/api/reference/webapi/SuperOffice.WebApi.Data.PreviewMailingHeader.md)
- [SuperOffice.WebApi.Data.Marketing GetPreviewMailingHeaderRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.Marketing_GetPreviewMailingHeaderRequest.md)
- [NSPreviewMailing](/en/automation/crmscript/reference/CRMScript.NetServer.NSPreviewMailing.md)
- [Get Preview Mailing](/en/api/reference/restful/agent/marketing_agent/get-preview-mailing.md)
