- 1.0.6 2025-09-23 Se convierten funciones void a Task
This commit is contained in:
15
Funciones.cs
15
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<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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user