- 2026-07-23 1.1.22 Mejora de rutinas de validación de emails
This commit is contained in:
@@ -42,9 +42,10 @@ Namespace Extensiones
|
||||
<Extension()>
|
||||
Public Function EsEmailValido(ByVal email As String) As Boolean
|
||||
Try
|
||||
email = email.NothingAVacio.Trim.ToLower
|
||||
Dim addr = New System.Net.Mail.MailAddress(email)
|
||||
Return addr.Address = email
|
||||
If String.IsNullOrWhiteSpace(email) Then Return False
|
||||
Dim patron As String = "^(?("")("".+?""@)|(([0-9A-Za-z]((\.|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*[0-9A-Za-z])?)))" &
|
||||
"@(([0-9A-Za-z]([-\w]*[0-9A-Za-z])?\.)+[A-Za-z]{2,})$"
|
||||
Return Regex.IsMatch(email, patron)
|
||||
Catch ex As Exception
|
||||
Return False
|
||||
End Try
|
||||
@@ -58,12 +59,7 @@ Namespace Extensiones
|
||||
Dim emails = Listaemail.Split(";")
|
||||
For Each email In emails
|
||||
email = email.NothingAVacio.Trim.ToLower
|
||||
If email <> "" Then
|
||||
Dim addr = New System.Net.Mail.MailAddress(email)
|
||||
If addr.Address <> email Then
|
||||
Throw New Exception("Email incorrecto")
|
||||
End If
|
||||
End If
|
||||
If EsEmailValido(email) = False Then Return False
|
||||
Next
|
||||
Return True
|
||||
End If
|
||||
|
||||
@@ -16,11 +16,12 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<PackageId>tsUtilidades</PackageId>
|
||||
<PackageTags>net8.0, libreria</PackageTags>
|
||||
<Version>1.1.21</Version>
|
||||
<Version>1.1.22</Version>
|
||||
<Authors>Manuel</Authors>
|
||||
<Company>Tecnosis S.A</Company>
|
||||
<Description>Utilidades Varias</Description>
|
||||
<PackageReleaseNotes>
|
||||
- 2026-07-23 1.1.22 Mejora de rutinas de validación de emails
|
||||
- 2026-07-22 1.1.21 Corrección de clase ValidacionDocumentosIdentidad
|
||||
- 2026-07-22 1.1.19 Nueva Clase ValidacionDocumentosIdentidad para documentos extranjeros
|
||||
- 2026-05-29 1.1.18 Corrección rutina LeeMysql y LeeMysqlBytArray para que como maximo se admitan 2048 caracteres string
|
||||
|
||||
Reference in New Issue
Block a user