From 8aca5823eb613fe16355dfe424274a2d5bf72c1f Mon Sep 17 00:00:00 2001 From: manuel Date: Fri, 26 Sep 2025 08:53:16 +0200 Subject: [PATCH] - 1.0.6 2025-09-23 Se convierten funciones void a Task --- Funciones.cs | 15 ++++++--------- tsCorreos.csproj | 3 ++- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Funciones.cs b/Funciones.cs index a3be3d9..4a65262 100644 --- a/Funciones.cs +++ b/Funciones.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Net; using System.Net.Mail; using System.Net.Mime; +using System.Threading.Tasks; namespace tsCorreos { @@ -13,7 +14,7 @@ namespace tsCorreos public static class Funciones { - public static async void EnviaCorreo(string ServidorSMTP, string Remitente, string Destinatario, string Asunto, string Cuerpo, List AttachMents = null, List AlternateViews = null, string CC = "", string BCC = "", string CuentaCorreo = "", string ContraseñaCorreo = "", int Puerto = 25, bool UsarSSL = false, bool CuerpoenHTML = false, string ResponderA = "", bool CredencialesConDominio = false, SecurityProtocolType ProtocoloSeguridad = SecurityProtocolType.Tls, string NombreRemitente = "") + public static async Task EnviaCorreo(string ServidorSMTP, string Remitente, string Destinatario, string Asunto, string Cuerpo, List AttachMents = null, List AlternateViews = null, string CC = "", string BCC = "", string CuentaCorreo = "", string ContraseñaCorreo = "", int Puerto = 25, bool UsarSSL = false, bool CuerpoenHTML = false, string ResponderA = "", bool CredencialesConDominio = false, SecurityProtocolType ProtocoloSeguridad = SecurityProtocolType.Tls, string NombreRemitente = "") { try { @@ -32,7 +33,7 @@ namespace tsCorreos throw new Exception(ex.Message, ex); } } - public static async void EnviaCorreoAL(string ServidorSMTP, string Remitente, string Destinatario, string Asunto, string Cuerpo, ArrayList FicherosAdjuntos = null, string CC = "", string BCC = "", string CuentaCorreo = "", string ContraseñaCorreo = "", int Puerto = 25, bool UsarSSL = false, string NombreRemitente = "") + public static async Task EnviaCorreoAL(string ServidorSMTP, string Remitente, string Destinatario, string Asunto, string Cuerpo, ArrayList FicherosAdjuntos = null, string CC = "", string BCC = "", string CuentaCorreo = "", string ContraseñaCorreo = "", int Puerto = 25, bool UsarSSL = false, string NombreRemitente = "") { try { @@ -52,7 +53,7 @@ namespace tsCorreos } } - public static void EnviaCorreoCompruebaHTML(string ServidorSMTP, string Remitente, string Destinatario, string Asunto, string Cuerpo, MemoryStream[] FicherosAdjuntos, string[] NombreFicherosAdjuntos, string CC = "", string BCC = "", string CuentaCorreo = "", string ContraseñaCorreo = "", int Puerto = 25, bool UsarSSL = false, bool CuerpoenHTML = false, string ResponderA = "", string NombreRemitente = "") + public static async Task EnviaCorreoCompruebaHTMLAsync(string ServidorSMTP, string Remitente, string Destinatario, string Asunto, string Cuerpo, MemoryStream[] FicherosAdjuntos, string[] NombreFicherosAdjuntos, string CC = "", string BCC = "", string CuentaCorreo = "", string ContraseñaCorreo = "", int Puerto = 25, bool UsarSSL = false, bool CuerpoenHTML = false, string ResponderA = "", string NombreRemitente = "") { try { @@ -80,7 +81,7 @@ namespace tsCorreos } else { - EnviaCorreoMS(ServidorSMTP, Remitente, Destinatario, Asunto, Cuerpo, FicherosAdjuntos, NombreFicherosAdjuntos, CC, BCC, CuentaCorreo, ContraseñaCorreo, Puerto, UsarSSL, CuerpoenHTML, ResponderA, NombreRemitente); + await EnviaCorreoMS(ServidorSMTP, Remitente, Destinatario, Asunto, Cuerpo, FicherosAdjuntos, NombreFicherosAdjuntos, CC, BCC, CuentaCorreo, ContraseñaCorreo, Puerto, UsarSSL, CuerpoenHTML, ResponderA, NombreRemitente); } } catch (Exception ex) @@ -90,10 +91,8 @@ namespace tsCorreos } - public static async void EnviaCorreoMS(string ServidorSMTP, string Remitente, string Destinatario, string Asunto, string Cuerpo, MemoryStream[] FicherosAdjuntos, string[] NombreFicherosAdjuntos, string CC = "", string BCC = "", string CuentaCorreo = "", string ContraseñaCorreo = "", int Puerto = 25, bool UsarSSL = false, bool CuerpoenHTML = false, string ResponderA = "", string NombreRemitente = "") + public static async Task EnviaCorreoMS(string ServidorSMTP, string Remitente, string Destinatario, string Asunto, string Cuerpo, MemoryStream[] FicherosAdjuntos, string[] NombreFicherosAdjuntos, string CC = "", string BCC = "", string CuentaCorreo = "", string ContraseñaCorreo = "", int Puerto = 25, bool UsarSSL = false, bool CuerpoenHTML = false, string ResponderA = "", string NombreRemitente = "") { - - try { if (ServidorSMTP == "smtp.gmail.com") @@ -110,8 +109,6 @@ namespace tsCorreos { throw new Exception(ex.Message, ex); } - - } } } \ No newline at end of file diff --git a/tsCorreos.csproj b/tsCorreos.csproj index 977e47b..dab7cab 100644 --- a/tsCorreos.csproj +++ b/tsCorreos.csproj @@ -6,11 +6,12 @@ netstandard2.0 tsCorreos netstandard2.0, libreria - 1.0.5 + 1.0.6 Manuel Tecnosis S.A Envío de correos diferenciando Gmail del resto + - 1.0.6 2025-09-23 Se convierten funciones void a Task - 1.0.5 2025-09-23 Corrección EnviaCorreoMS - 1.0.4 2025-09-22 Actualización de tsGmail - 1.0.3 2025-09-22 Actualización de tsGmail