SMTPSecureSocket

how i can get the error msg ( i have a error but no from server)
SMTPSecureSocket.error <<

my code (the Error code is 102)

eMailServer.Address ="smtp.myhost.com"
eMailServer.Secure = True
eMailServer.SMTPConnectionMode=0

eMailServer.ConnectionType=SSLSocket.TLSv1
eMailServer.Port = 587
eMailServer.Username ="acolon@myhost.com"
eMailServer.Password ="test101"
eMailServer.Connect()

this is correct or no

No. You do not call Connect on an SMTP socket. Just SendMail. The connection is handled behind the scenes. SendMail connects, transmits, and disconnects. You do not keep a connection to the server.

And error 102 is really not an error. It just means the connection has dropped. SMTPSockets will do that quite a bit.

but the email no get to any place.
i remove the eMailServer.Connect()

First you create the email message http://documentation.xojo.com/index.php/EmailMessage

Then you append that email to the socket. http://documentation.xojo.com/index.php/SMTPSecureSocket.Messages

Then you call SendMail. http://documentation.xojo.com/index.php/SMTPSecureSocket.SendMail

You do NOT have to call Connect. The socket connects and disconnects for you automatically.

and make sure you keep the socket around long enough so it doesnt go out of scope immediately
it will never send if you dont

[quote=156182:@Norman Palardy]and make sure you keep the socket around long enough so it doesnt go out of scope immediately
it will never send if you dont[/quote]

how do i keep the socket around long enough??

Instantiate it in a scope that lives the intended time. For example, a property in the window showing a progress bar of the sending job. It will die only when the window gets closed and all the window properties got released/destructed.