- 1.0.6 2025-09-23 Se convierten funciones void a Task

This commit is contained in:
2025-09-26 08:53:16 +02:00
parent d5d37d900b
commit 8aca5823eb
2 changed files with 8 additions and 10 deletions

View File

@@ -6,6 +6,7 @@ using System.Linq;
using System.Net; using System.Net;
using System.Net.Mail; using System.Net.Mail;
using System.Net.Mime; using System.Net.Mime;
using System.Threading.Tasks;
namespace tsCorreos namespace tsCorreos
{ {
@@ -13,7 +14,7 @@ namespace tsCorreos
public static class Funciones public static class Funciones
{ {
public static async void EnviaCorreo(string ServidorSMTP, string Remitente, string Destinatario, string Asunto, string Cuerpo, List<Attachment> AttachMents = null, List<AlternateView> 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<Attachment> AttachMents = null, List<AlternateView> 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 try
{ {
@@ -32,7 +33,7 @@ namespace tsCorreos
throw new Exception(ex.Message, ex); 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 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 try
{ {
@@ -80,7 +81,7 @@ namespace tsCorreos
} }
else 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) 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 try
{ {
if (ServidorSMTP == "smtp.gmail.com") if (ServidorSMTP == "smtp.gmail.com")
@@ -110,8 +109,6 @@ namespace tsCorreos
{ {
throw new Exception(ex.Message, ex); throw new Exception(ex.Message, ex);
} }
} }
} }
} }

View File

@@ -6,11 +6,12 @@
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<PackageId>tsCorreos</PackageId> <PackageId>tsCorreos</PackageId>
<PackageTags>netstandard2.0, libreria</PackageTags> <PackageTags>netstandard2.0, libreria</PackageTags>
<Version>1.0.5</Version> <Version>1.0.6</Version>
<Authors>Manuel</Authors> <Authors>Manuel</Authors>
<Company>Tecnosis S.A</Company> <Company>Tecnosis S.A</Company>
<Description>Envío de correos diferenciando Gmail del resto</Description> <Description>Envío de correos diferenciando Gmail del resto</Description>
<PackageReleaseNotes> <PackageReleaseNotes>
- 1.0.6 2025-09-23 Se convierten funciones void a Task
- 1.0.5 2025-09-23 Corrección EnviaCorreoMS - 1.0.5 2025-09-23 Corrección EnviaCorreoMS
- 1.0.4 2025-09-22 Actualización de tsGmail - 1.0.4 2025-09-22 Actualización de tsGmail
- 1.0.3 2025-09-22 Actualización de tsGmail - 1.0.3 2025-09-22 Actualización de tsGmail