# CID

CID es una forma especial de insertar imágenes u otros archivos multimedia directamente en el cuerpo del correo, para que se muestren de inmediato, sin necesidad de descargarlos por separado.

1. En el correo, las imágenes se insertan a través de la etiqueta `<img src='cid:ID_unico'>`.
2. El ID único (Content-ID) vincula la imagen con esta etiqueta.
3. En la base de datos se almacenan estos ID y las propias imágenes.
4. Al mostrar el correo, el programa busca las imágenes por estos ID y las muestra.

> Esta construcción funciona para páginas web, sin embargo, Outlook puede no mostrar estas imágenes. Esto es especialmente relevante para Office 2019.

## Configuración de conexión a Exchange

<pre class="language-html" data-overflow="wrap"><code class="lang-html">$exchangeVersion = [Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2016 
$service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService($exchangeVersion) 
<strong>$service.Credentials = New-Object System.Net.NetworkCredential($        , $        ) 
</strong>$service.Url = "https://        /        /Exchange.asmx"
</code></pre>

## Creación del correo

```html
$email = New-Object Microsoft.Exchange.WebServices.Data.EmailMessage($service) 
$email.Subject = $subject 
$email.Body = New-Object Microsoft.Exchange.WebServices.Data.MessageBody( 
    [Microsoft.Exchange.WebServices.Data.BodyType]::HTML, 
    "<html><body><p style = `"font-size: 15px; font-family: Calibri;`">${$header}<br>${$link}<br></p><img src='cid:MyImage'>$($        )</body></html>"
)
$emailAddresses = $Row.emails -split ';' | ForEach-Object { $_.Trim() } 
foreach ($address in $emailAddresses) { 
    $email.ToRecipients.Add($address) 
}
```

## Adición de un archivo adjunto con ContentId

```html
$filePath = $        
$attachment = $email.Attachments.AddFileAttachment($filePath) 
$attachment.ContentId = "MyImage" 
$attachment.IsInline = $true
```

## Envío del correo

```html
$email.SendAndSaveCopy()
```


---

# 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.sherparpa.ru/es/sherpa-rpa/sherpa-designer/rabota-v-sherpa-designer/paneli-svoistv-i-peremennykh-i-rabota-s-nimi/panel-svoistv/rabota-s-vyrazheniyami/cid.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.
