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

# NSEMailConnectionInfo

> All information needed to connect to a mail server.

All information needed to connect to a mail server.

## Constructors

### NSEMailConnectionInfo()

```crmscript theme={null}
NSEMailConnectionInfo
```

Initializes a new instance of the NSEMailConnectionInfo class.

## Methods

## GetFolder()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Optional folder to set as current after logging in.

**Example:**

```crmscript theme={null}
NSEMailConnectionInfo thing;
String folder = thing.GetFolder();
```

## GetPassword()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Password for the username.

**Example:**

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

## GetServerName()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Hostname or IP to server to connect to. Custom ports may be specified by adding ':' and the port number after the name/ip. For example, '127.0.0.1:6543'

**Example:**

```crmscript theme={null}
NSEMailConnectionInfo thing;
String serverName = thing.GetServerName();
```

## GetUserName()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Name of user to log in with.

**Example:**

```crmscript theme={null}
NSEMailConnectionInfo thing;
String userName = thing.GetUserName();
```

## GetUseSSL()

```crmscript theme={null}
Bool GetUseSSL()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Use a secure connection with the server.

**Example:**

```crmscript theme={null}
NSEMailConnectionInfo thing;
Bool useSSL = thing.GetUseSSL();
```

## SetFolder(String)

```crmscript theme={null}
Void SetFolder(String folder)
```

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

**Example:**

```crmscript theme={null}
NSEMailConnectionInfo thing;
String folder;
thing.SetFolder(folder);
```

## SetPassword(String)

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

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

**Example:**

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

## SetServerName(String)

```crmscript theme={null}
Void SetServerName(String serverName)
```

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

**Example:**

```crmscript theme={null}
NSEMailConnectionInfo thing;
String serverName;
thing.SetServerName(serverName);
```

## SetUserName(String)

```crmscript theme={null}
Void SetUserName(String userName)
```

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

**Example:**

```crmscript theme={null}
NSEMailConnectionInfo thing;
String userName;
thing.SetUserName(userName);
```

## SetUseSSL(Bool)

```crmscript theme={null}
Void SetUseSSL(Bool useSSL)
```

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

**Example:**

```crmscript theme={null}
NSEMailConnectionInfo thing;
Bool useSSL;
thing.SetUseSSL(useSSL);
```


## Related topics

- [Namespace CRMScript.NetServer](/en/automation/crmscript/reference/CRMScript.NetServer.md)
- [Create Default E Mail Connection Info](/en/api/reference/restful/agent/email_agent/create-default-e-mail-connection-info.md)
- [Create Default E Mail Connection Info Extended](/en/api/reference/restful/agent/email_agent/create-default-e-mail-connection-info-extended.md)
- [SuperOffice.WebApi.Data.EMailConnectionInfo](/en/api/reference/webapi/SuperOffice.WebApi.Data.EMailConnectionInfo.md)
- [SuperOffice.WebApi.Data.EMailConnectionInfoExtended](/en/api/reference/webapi/SuperOffice.WebApi.Data.EMailConnectionInfoExtended.md)
- [Get E Mail As Stream](/en/api/reference/restful/agent/email_agent/get-e-mail-as-stream.md)
