After any successful file export from the Data Fusion Arena — whether the output is JSON, TXT, XML, XLSX, or CSV — the application offers to send the file by email. This opensDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/XxLunaxX29/ExploradorDeArchivos/llms.txt
Use this file to discover all available pages before exploring further.
FormCorreoEnvio, which uses MailKit and MimeKit to connect to an SMTP server, authenticate, attach the exported file, and deliver the message asynchronously without blocking the UI.
How It Works
- After a successful export,
FormDataBasecallsOfrecerEnviarPorCorreo(rutaArchivo)with the path returned by theSaveFileDialog. - A
MessageBox.Showprompt asks the user whether to send the file, displaying the filename in the message text. - If the user clicks Yes,
new FormCorreoEnvio(rutaArchivo).ShowDialog()opens the send dialog with the attachment path already set. - The dialog pre-fills the Subject field as
"Archivo exportado: {filename}"and provides a default message body. The user only needs to enter the recipient address. - On clicking Send, MailKit’s
SmtpClientconnects to the configured SMTP host usingSecureSocketOptions.StartTls, authenticates with the sender credentials, attaches the file viaBodyBuilder.Attachments.Add(path), and sends the message asynchronously withawait smtp.SendAsync(msg). - A success dialog confirms the recipient address. If authentication fails, a specific error message is shown distinguishing credential errors from general network failures.
EmailSettings
Sender preferences are persisted between sessions using a lightweight JSON file stored inApplication.UserAppDataPath. The EmailSettings class provides two static methods to read and write the saved sender address.
Common SMTP Settings
The current implementation connects to Gmail on port 587 with STARTTLS. To target a different provider, update theSmtpHost, SmtpPort, and sender credential constants in FormCorreoEnvio.cs.
| Provider | Host | Port | Security |
|---|---|---|---|
| Gmail | smtp.gmail.com | 587 | TLS |
| Outlook / Hotmail | smtp.office365.com | 587 | TLS |
| Yahoo | smtp.mail.yahoo.com | 465 | SSL |
The file attached to the email is read from the exact path returned by the
SaveFileDialog during export. If the file is moved, renamed, or deleted before the send dialog is submitted, the Validar() method will detect the missing file with File.Exists(_archivoAdjunto) and show an error — no email will be sent.