Sub emailadmin
Dim lssmtp,lscuenta,lspassword,lsasunto,lsadmin,lsclau,lscodi As String
Dim lipuerto,lissl,litsl As Int
lcregistro=sql1.ExecQuery("SELECT smtp,puerto,cuenta,password,ssl,tsl,emailadmin,clau,asunto FROM tconfig")
Do While lcregistro.NextRow
lsasunto="XXXXX"
lssmtp=lcregistro.GetString("smtp")
lipuerto=lcregistro.GetInt("puerto")
lscuenta=lcregistro.GetString("cuenta")
lspassword=lcregistro.GetString("password")
lissl=lcregistro.GetInt("ssl")
litsl=lcregistro.GetInt("tsl")
lsadmin=lcregistro.GetString("emailadmin")
lsclau=lcregistro.GetString("clau")
lscodi=lcregistro.GetString("asunto")
Exit
Loop
lcregistro.Close
smtp.Initialize(lssmtp,lipuerto,lscuenta,lspassword, "SMTP")
If lissl=0 Then
smtp.UseSSL = False
Else
smtp.UseSSL = True
End If
If litsl=0 Then
smtp.StartTLSMode=False
Else
smtp.StartTLSMode=True
End If
lsbody="aaaaaa"
smtp.To.Add(lsadmin)
smtp.Subject = lsasunto
smtp.Body = lsbody
smtp.Send
End Sub
Private Sub SMTP_MessageSent(Success As Boolean)
Log(Success)
If Success Then
Else
Log(LastException.Message)
End If
End Sub