- 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.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<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
{
@@ -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);
}
}
}
}