Greetings,
I am programming in VB through VS2017, I made a program that sends email to the email accounts that specific. The problem is that the mail does not reach the recipients, it only comes when I close the application.
I would appreciate any help, then I show you a summary of the code:
Dim _smtpMessage As New Net.Mail.MailMessage
Dim _smtpServer As New Net.Mail.SmtpClient
Dim _autenticationUser As String = "[email protected]"
Dim _autenticationPassword As String = "password"
_smtpServer.Host = "servidor.dominio.com" 'uso una cuenta de gmail
_smtpServer.Port = 587
_smtpServer.Credentials = New Net.NetworkCredential(cuenta de correo, contraseña)
_smtpServer.EnableSsl = CBool(IIf(condicion = 1, True, False))
_smtpMessage.From = New Net.Mail.MailAddress(cuenta de correo)
_smtpMessage.Subject = "En prueba"
_smtpMessage.Body = "Contenido del mensaje"
_smtpConfig._Email01 = "[email protected]"
_smtpMessage.To.Add(_smtpConfig._Email01)
_smtpServer.Send(_smtpMessage)
With all the correct values the program runs perfectly, but the emails do not leave the program if I do not close the application ...