> ## 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.

# NSMailboxEntity

## Constructors

### NSMailboxEntity()

```crmscript theme={null}
NSMailboxEntity
```

## Methods

## GetAddress()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The address associated with this mailbox (used as FROM address when sending emails).

**Example:**

```crmscript theme={null}
NSMailboxEntity thing;
String address = thing.GetAddress();
```

## GetMailInFilterId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The primary key (auto-incremented).

**Example:**

```crmscript theme={null}
NSMailboxEntity thing;
Integer mailInFilterId = thing.GetMailInFilterId();
```

## GetPassword()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The password used to log into the mail account. This is hidden when reading.

**Example:**

```crmscript theme={null}
NSMailboxEntity thing;
String password = thing.GetPassword();
```

## GetPort()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The port used to connect to the server.

**Example:**

```crmscript theme={null}
NSMailboxEntity thing;
Integer port = thing.GetPort();
```

## GetServer()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The email server to connect to.

**Example:**

```crmscript theme={null}
NSMailboxEntity thing;
String server = thing.GetServer();
```

## GetServerType()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The protocol to use (POP/IMAP). See \<xref href="CRMScript.NetServer.MailboxType" data-throw-if-not-resolved="false">\</xref>

**Example:**

```crmscript theme={null}
NSMailboxEntity thing;
Integer serverType = thing.GetServerType();
```

## GetUsername()

\\

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - nThe username used to log onto the mail account.

**Example:**

```crmscript theme={null}
NSMailboxEntity thing;
String username = thing.GetUsername();
```

## SetAddress(String)

```crmscript theme={null}
Void SetAddress(String address)
```

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

**Example:**

```crmscript theme={null}
NSMailboxEntity thing;
String address;
thing.SetAddress(address);
```

## SetMailInFilterId(Integer)

```crmscript theme={null}
Void SetMailInFilterId(Integer mailInFilterId)
```

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

**Example:**

```crmscript theme={null}
NSMailboxEntity thing;
Integer mailInFilterId;
thing.SetMailInFilterId(mailInFilterId);
```

## SetPassword(String)

```crmscript theme={null}
Void SetPassword(String password)
```

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

**Example:**

```crmscript theme={null}
NSMailboxEntity thing;
String password;
thing.SetPassword(password);
```

## SetPort(Integer)

```crmscript theme={null}
Void SetPort(Integer port)
```

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

**Example:**

```crmscript theme={null}
NSMailboxEntity thing;
Integer port;
thing.SetPort(port);
```

## SetServer(String)

```crmscript theme={null}
Void SetServer(String server)
```

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

**Example:**

```crmscript theme={null}
NSMailboxEntity thing;
String server;
thing.SetServer(server);
```

## SetServerType(Integer)

```crmscript theme={null}
Void SetServerType(Integer serverType)
```

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

**Example:**

```crmscript theme={null}
NSMailboxEntity thing;
Integer serverType;
thing.SetServerType(serverType);
```

## SetUsername(String)

```crmscript theme={null}
Void SetUsername(String username)
```

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

**Example:**

```crmscript theme={null}
NSMailboxEntity thing;
String username;
thing.SetUsername(username);
```


## Related topics

- [NSCustomerServiceAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSCustomerServiceAgent.md)
- [Save Mailbox Entity](/en/api/reference/restful/agent/customerservice_agent/save-mailbox-entity.md)
- [Get Mailbox Entity](/en/api/reference/restful/agent/customerservice_agent/get-mailbox-entity.md)
- [Create Default Mailbox Entity](/en/api/reference/restful/agent/customerservice_agent/create-default-mailbox-entity.md)
- [SuperOffice.WebApi.Data.MailboxEntity](/en/api/reference/webapi/SuperOffice.WebApi.Data.MailboxEntity.md)
- [SuperOffice.WebApi.Agents.ICustomerServiceAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.ICustomerServiceAgent.md)
