Repository: mindsdb/mindsdb
Pull request: Outlook to Email docs
## Description

This PR updates the docs and readme for the Email integration with additional info about connecting to Outlook.

Fixes #7647 

## Type of change

(Please delete options that are not relevant)

- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ⚡ New feature (non-breaking change which adds functionality)
- [ ] 📢 Breaking change (fix or feature that would cause existing functionality not to work as expected)
- [X] 📄 Docs changes







Problem statement:
[Docs]: Add information about connecting to Outlook
The missing documentation for connecting to Outlook affects users who prefer to use Outlook as their email provider. Without the necessary information, users may face difficulties in configuring their email settings and connecting to their Outlook accounts.

Hints from issue discussion:

Commit message: Update email README

Patch to review:
diff --git a/docs/integrations/app-integrations/email.mdx b/docs/integrations/app-integrations/email.mdx
index afeea2df84b..db2faff2cef 100644
--- a/docs/integrations/app-integrations/email.mdx
+++ b/docs/integrations/app-integrations/email.mdx
@@ -8,7 +8,7 @@ In this section, we present how to connect Email accounts to MindsDB.
 By connecting your email account to MindsDB, you can utilize various AI models available within MindsDB to summarize emails, detect spam, or even automate email replies.
 
 <Note>
-Please note that currently you can connect Gmail accounts using this integration.
+Please note that currently you can connect Gmail and Outlook accounts using this integration.
 </Note>
 
 ## Connection
@@ -21,7 +21,7 @@ The Email handler is initialized with the following required parameters:
 * `password` stores a password used for authentication.
 
 <Tip>
-At the moment, the handler has only been tested with Gmail accounts.
+At the moment, the handler has only been tested with Gmail and Outlook accounts.
 
 To use the handler on a Gmail account, you must create an app password following [this instruction](https://support.google.com/accounts/answer/185833?hl=en).
 </Tip>
@@ -32,7 +32,14 @@ Additionally, the following optional parameters can be passed:
 * `smtp_port` used to send emails. Defaults to `587`.
 * `imap_server` used to receive emails. Defaults to `imap.gmail.com`.
 
-To connect your email account to MindsDB, use the below `CREATE DATABASE` statement:
+<Tip>
+By default, the email handlers connects to Gmail. If you want to use other email providers as Outlook, 
+add the values for `imap_server` and `smtp_server`.
+</Tip>
+
+### Connect to Gmail
+
+To connect your Gmail account to MindsDB, use the below `CREATE DATABASE` statement:
 
 ```sql
 CREATE DATABASE email_datasource
@@ -70,3 +77,47 @@ Or, write emails like this:
 INSERT INTO email_datasource.emails(to, subject, body)
 VALUES ("toemail@email.com", "MindsDB", "Hello from MindsDB!");
 ```
+
+### Connect to Outlook
+
+To connect your Outlook account to MindsDB, use the below `CREATE DATABASE` statement:
+
+```sql
+CREATE DATABASE email_datasource
+WITH ENGINE = 'email',
+PARAMETERS = {
+  "email": "youremail@gmail.com",
+  "password": "yourpassword",
+  "smtp_server": "smtp.office365.com", 
+  "smtp_port": "587", 
+  "imap_server": "outlook.office365.com" 
+};
+```
+
+It creates a database that comes with the `emails` table.
+
+## Usage
+
+Now you can query for emails like this:
+
+```sql
+SELECT *
+FROM email_datasource.emails;
+```
+
+And you can apply filters like this:
+
+```sql
+SELECT id, to, subject, body
+FROM email_datasource.emails
+WHERE subject = 'MindsDB'
+ORDER BY id
+LIMIT 5;
+```
+
+Or, write emails like this:
+
+```sql
+INSERT INTO email_datasource.emails(to, subject, body)
+VALUES ("toemail@outlook.com", "MindsDB", "Hello from MindsDB!");
+```
diff --git a/mindsdb/integrations/handlers/email_handler/README.md b/mindsdb/integrations/handlers/email_handler/README.md
index e9dbc05c40d..3d0675e0674 100644
--- a/mindsdb/integrations/handlers/email_handler/README.md
+++ b/mindsdb/integrations/handlers/email_handler/README.md
@@ -35,7 +35,7 @@ Additionally, the following optional parameters can be passed:
 - `smtp_port`: SMTP port to use for sending emails. Defaults to `587`.
 - `imap_server`: IMAP server to use for receiving emails. Defaults to `imap.gmail.com`.
 
-At the moment, the handler has only been tested with Gmail accounts.
+At the moment, the handler has only been tested with Gmail and Outlook accounts.
 
 ## Implemented Features
 
@@ -50,40 +50,83 @@ At the moment, the handler has only been tested with Gmail accounts.
 
 ## TODO
 
-- [ ] Test the handler for other email providers like Outlook, Yahoo, etc.
+- [ ] Test the handler for other email providers like Yahoo, etc.
 
-## Example Usage
 
-The first step is to create a database with the new `email` engine by passing in the required `email` and `password` parameters:
+### Connect to Gmail
 
-~~~~sql
+To connect your Gmail account to MindsDB, use the below `CREATE DATABASE` statement:
+
+```sql
 CREATE DATABASE email_datasource
 WITH ENGINE = 'email',
 PARAMETERS = {
   "email": "youremail@gmail.com",
   "password": "yourpassword"
 };
-~~~~
+```
+
+It creates a database that comes with the `emails` table.
+
+## Usage
 
-Use the established connection to query your emails:
+Now you can query for emails like this:
 
-~~~~sql
-SELECT * FROM email_datasource.emails
-~~~~
+```sql
+SELECT *
+FROM email_datasource.emails;
+```
 
-Run more advanced queries:
+And you can apply filters like this:
 
-~~~~sql
-SELECT  id, to, subject, body
+```sql
+SELECT id, to, subject, body
 FROM email_datasource.emails
 WHERE subject = 'MindsDB'
 ORDER BY id
-LIMIT 5
-~~~~
+LIMIT 5;
+```
 
-Send emails:
+Or, write emails like this:
 
-~~~~sql
+```sql
 INSERT INTO email_datasource.emails(to, subject, body)
-VALUES ("toemail@gmail.com", "MindsDB", "Hello from MindsDB!")
-~~~~
\ No newline at end of file
+VALUES ("toemail@email.com", "MindsDB", "Hello from MindsDB!");
+```
+
+### Connect to Outlook
+
+To connect your Outlook account to MindsDB, use the below `CREATE DATABASE` statement:
+
+```sql
+CREATE DATABASE email_datasource
+WITH ENGINE = 'email',
+PARAMETERS = {
+  "email": "youremail@gmail.com",
+  "password": "yourpassword",
+  "smtp_server": "smtp.office365.com", 
+  "smtp_port": "587", 
+  "imap_server": "outlook.office365.com" 
+};
+```
+
+It creates a database that comes with the `emails` table.
+
+## Usage
+
+Now you can query for emails like this:
+
+```sql
+SELECT *
+FROM email_datasource.emails;
+```
+
+And you can apply filters like this:
+
+```sql
+SELECT id, to, subject, body
+FROM email_datasource.emails
+WHERE subject = 'MindsDB'
+ORDER BY id
+LIMIT 5;
+```


Code review comments:
diff_hunk: @@ -50,40 +50,83 @@ At the moment, the handler has only been tested with Gmail accounts.
 
 ## TODO
 
-- [ ] Test the handler for other email providers like Outlook, Yahoo, etc.
+- [ ] Test the handler for other email providers like Yahoo, etc.
 
-## Example Usage
 
-The first step is to create a database with the new `email` engine by passing in the required `email` and `password` parameters:
+### Connect to Gmail
 
-~~~~sql
+To connect your Gmail account to MindsDB, use the below `CREATE DATABASE` statement:
+
+```sql
 CREATE DATABASE email_datasource
 WITH ENGINE = 'email',
 PARAMETERS = {
   "email": "youremail@gmail.com",
   "password": "yourpassword"
 };
-~~~~
+```
+
+It creates a database that comes with the `emails` table.
+
+## Usage
 
-Use the established connection to query your emails:
+Now you can query for emails like this:
 
-~~~~sql
-SELECT * FROM email_datasource.emails
-~~~~
+```sql
+SELECT *
+FROM email_datasource.emails;
+```
 
-Run more advanced queries:
+And you can apply filters like this:
 
-~~~~sql
-SELECT  id, to, subject, body
+```sql
+SELECT id, to, subject, body
 FROM email_datasource.emails
 WHERE subject = 'MindsDB'
 ORDER BY id
-LIMIT 5
-~~~~
+LIMIT 5;
+```
 
-Send emails:
+Or, write emails like this:
 
-~~~~sql
+```sql
 INSERT INTO email_datasource.emails(to, subject, body)
-VALUES ("toemail@gmail.com", "MindsDB", "Hello from MindsDB!")
-~~~~
\ No newline at end of file
+VALUES ("toemail@email.com", "MindsDB", "Hello from MindsDB!");
+```
+
+### Connect to Outlook
+
+To connect your Outlook account to MindsDB, use the below `CREATE DATABASE` statement:
+
+```sql
+CREATE DATABASE email_datasource
+WITH ENGINE = 'email',
+PARAMETERS = {
+  "email": "youremail@gmail.com",
+  "password": "yourpassword",
+  "smtp_server": "smtp.office365.com", 
+  "smtp_port": "587", 
+  "imap_server": "outlook.office365.com" 
+};
+```
+
+It creates a database that comes with the `emails` table.
+
+## Usage
path: mindsdb/integrations/handlers/email_handler/README.md
text: @user1:
If this Usage is for Outlook, then let's make it a subsection like `#### Usage` or just remove this line.

diff_hunk: @@ -50,40 +50,83 @@ At the moment, the handler has only been tested with Gmail accounts.
 
 ## TODO
 
-- [ ] Test the handler for other email providers like Outlook, Yahoo, etc.
+- [ ] Test the handler for other email providers like Yahoo, etc.
 
-## Example Usage
 
-The first step is to create a database with the new `email` engine by passing in the required `email` and `password` parameters:
+### Connect to Gmail
 
-~~~~sql
+To connect your Gmail account to MindsDB, use the below `CREATE DATABASE` statement:
+
+```sql
 CREATE DATABASE email_datasource
 WITH ENGINE = 'email',
 PARAMETERS = {
   "email": "youremail@gmail.com",
   "password": "yourpassword"
 };
-~~~~
+```
+
+It creates a database that comes with the `emails` table.
+
+## Usage
path: mindsdb/integrations/handlers/email_handler/README.md
text: @user1:
If this Usage is for Gmail, then let's make it a subsection like `#### Usage` or just remove this line.