# Email & Storage Providers

There are two providers currently added for handling email and file storage (The media uses this provider for saving media).

### IStorageProvider

Responsible for saving media and files, the built in provider is the DiskStorageProvider that saves files to the local disk

{% @github-files/github-code-block url="<https://github.com/YodasMyDad/ZauberCMS/blob/main-mvc/ZauberCMS.Core/Providers/DiskStorageProvider.cs>" %}

You can replace this by creating your own provider that implements IStorageProvider and then update the appSettings to point to your provider instead of the Disk provider.

```json
"Plugins": {
  "StorageProvider": "ZauberCMS.Core.Providers.DiskStorageProvider",
}
```

### IEmailProvider

The email provider is responsible for sending all emails within the CMS, currently the default provider is an SMTP provider

{% @github-files/github-code-block url="<https://github.com/YodasMyDad/ZauberCMS/blob/main-mvc/ZauberCMS.Core/Providers/SmtpEmailProvider.cs>" %}

Where you can set you your SMTP details in the appSettings

```json
  "Plugins": {
    "EmailProvider": "ZauberCMS.Core.Providers.SmtpEmailProvider"
  }
```

Just like the StorageProvider you can create your own if you implement IEmailProvider and then replace the default one in the appSettings

```json
"Email": {
  "SenderEmail": "name@websitename.co.uk",
  "Smtp": {
    "Host": "smtp.sendgrid.net",
    "Port": 587,
    "Username": "mail_username",
    "Password": "mail_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://aptitude.gitbook.io/zaubercms/extending-zaubercms/email-and-storage-providers.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.
