# 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)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rubrik.gitbook.io/rubrik-sdk-for-python/cluster-functions/configure_smtp_settings.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
