# Mailkit

MailKit is an open-source, cross-platform .NET library used for sending and receiving emails. It provides a robust and comprehensive set of features for interacting with email servers using the IMAP, POP3, and SMTP protocols. Built on top of Mimekit, MailKit enables developers to handle complex email operations, including MIME encoding, authentication, and more.&#x20;

## Prerequisites

1. **An iX Hello Account**

For steps to create an iX Hello account, use the following steps:&#x20;

<https://docs.ixhello.com/ixhc/general/ixhello-create-account>

2. **An app in the ix Hello account**

One app in ix Hello should be created and at least one Utterance as well.

3. **An active email account to be created** using either - Gmail, Hotmail (now Outlook.com), and Yahoo or any email service providers. Which offer platforms for sending, receiving, and managing email messages.

4. Let's integrate Mailkit with iX Hello.

   1. Step 1 Connect to Mailkit
   2. Login to the iX Hello at  [https://bots.ixhello.com](https://bots.ixhello.com/)
   3. To Configure Mailkit, browse to: Integration > Connect System > Add New Connection in the iX Hello platform and select options as shown below.

   <figure><img src="/files/Jo3xNz2jiZx7RoygHqKm" alt=""><figcaption></figcaption></figure>

5. Click **Add New Connection**, choose **MailKit** from the **Connect External System** dropdown, and then click "Next"

<figure><img src="/files/7ztrU1rvUVJPQvdDqH6g" alt=""><figcaption></figcaption></figure>

3. Once you click on “Next” button, you will be redirected to the configuration screen where you need to provide connection information as shown below.

Service Instance Name: MailKitConnection

Smtp Host: smtp.gmail.com

Smtp Port: 587

Smtp Username: \*\*\*\*\*\*@gmail.com

Smtp Password: u\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

Note: Generate app passcode for the newly created or already existing Gmail ID

**Steps to generate app passcode:**

```
Go to your Google Account
Visit: https://myaccount.google.com

Sign in (if not already signed in)

Navigate to Security Settings

On the left sidebar, click “Security”
Ensure 2-Step Verification is On

Under “Signing in to Google”, check if 2-Step Verification is enabled.
If not, click it and follow the steps to enable it.
Click on “App Passwords”

This option appears only after 2-Step Verification is enabled.
You may need to re-enter your password.
Generate the App Password

Under “Select app”, choose the app you want (e.g., Mail).
Under “Select device”, choose the device (or select “Other” and name it).
Click “Generate”.
Copy the 16-character password

Use this password in place of your regular Google password in the app.
```

Enable SSL : true

Click on Validate and Save Settings

<figure><img src="/files/EdFvmvTRzYqlg5JYaDY2" alt=""><figcaption></figcaption></figure>

Once clicked on Validate and Save Settings, the connection will be enabled and successful.

<figure><img src="/files/n4PoLqo4LLm5vavLAT3W" alt=""><figcaption></figcaption></figure>

Once the integration is completed, lets go ahaed and create the custom app.


---

# 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://docs.ixhello.com/ixhc/mailkit.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.
