> For the complete documentation index, see [llms.txt](https://rubrik.gitbook.io/rubrik-sdk-for-python/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rubrik.gitbook.io/rubrik-sdk-for-python/cluster-functions/configure_smtp_settings.md).

# configure\_smtp\_settings

The Rubrik cluster uses email to send all notifications to local Rubrik cluster user accounts that have the Admin role. To do this the Rubrik cluster transfers the email messages to an SMTP server for delivery. This function will configure the Rubrik cluster with account information for the SMTP server to permit the Rubrik cluster to use the SMTP server for sending outgoing email.

```python
def configure_smtp_settings(hostname, port, from_email, smtp_username, smtp_password, encryption="NONE", timeout=15)
```

## Arguments

| Name           | Type | Description                                                                                                            | Choices |
| -------------- | ---- | ---------------------------------------------------------------------------------------------------------------------- | ------- |
| hostname       | str  | Hostname of the SMTP server.                                                                                           |         |
| port           | int  | Incoming port on the SMTP server. Normally port 25, port 465, or port 587, depending upon the type of encryption used. |         |
| from\_email    | str  | The email address assigned to the account on the SMTP server                                                           |         |
| smtp\_username | str  | The username assigned to the account on the SMTP server                                                                |         |
| smtp\_password | str  | The password associated with the username                                                                              |         |

## Keyword Arguments

| Name       | Type | Description                                                                                                  | Choices             | Default |
| ---------- | ---- | ------------------------------------------------------------------------------------------------------------ | ------------------- | ------- |
| encryption | str  | The encryption protocol that the SMTP server requires for incoming SMTP connections                          | NONE, SSL, STARTTLS | NONE    |
| timeout    | int  | The number of seconds to wait to establish a connection the Rubrik cluster before returning a timeout error. |                     | 15      |

## Returns

| Type | Return Value                                                                                  |
| ---- | --------------------------------------------------------------------------------------------- |
| str  | No change required. The Rubrik cluster is already configured with the provided SMTP settings. |
| dict | The full API response for `POST /internal/smtp_instance`                                      |
| dict | The full API response for `PATCH /internal/smtp_instance/{id}`                                |

## Example

```python
import rubrik_cdm

rubrik = rubrik_cdm.Connect()

hostname = "smtp1"
port = 25
from_email = "python@sdk.com"
smtp_username = "pythonuser"
smtp_password = "pythonpass"

smtp_settings = rubrik.configure_smtp_settings(hostname, port, from_email, smtp_username, smtp_password)
```
