Sub SendEmail()
Dim mail As SMTP
Dim SMTP_SSL_Port As Int = 465 'for SSL
Dim SMTP_TLS_Port As Int = 587 'for TLS
Try
mail.Initialize("smtp.google.com", 465, "MyUserName@gmail.com", "MyPassword", "SMTP")
mail.UseSSL=True
Dim M As Map
M.Initialize
M.Put("From","MySelf <MyUserName@gmail.com>")
mail.AdditionalHeaders = M
mail.To.Add("SMTP_SendTO")
mail.Subject = "SMTP_Subject"
mail.Body = "SMTP_Body"
mail.AddAttachment(fPath, fName)
mail.Send
Wait For smtp_MessageSent(Success As Boolean)
Log(Success)
If Success = True Then
ToastMessageShow("Message sent successfully", True)
Else
ToastMessageShow("Error sending message", True)
Log(LastException.Message)
End If
Catch
Log(LastException.Message)
End Try
End Sub