I used this code in desktop application that works fine.
[code] Dim mail as New EmailMessage
Dim SMTPSecureSocket1 as New SMTPSecureSocket
SMTPSecureSocket1.address = “smtp.gmail.com”
SMTPSecureSocket1.port = 587
SMTPSecureSocket1.Secure = True
SMTPSecureSocket1.ConnectionType = 3
SMTPSecureSocket1.Username = “firstname.lastname@example.org”
SMTPSecureSocket1.Password = “mypassword”
Dim Start as New Date
Dim Now as New Date
if Now.TotalSeconds - Start.TotalSeconds > 60 Then Exit
if SMTPSecureSocket1.IsConnected Then Exit
The same code in Run.Event of a console application doesn’t send the email.