Timeout = ElapsedMilliseconds() + 15000
Result = SendMail(0, "smtp.free.fr", 25, #PB_Mail_Asynchronous)
Repeat
Progress = MailProgress(0)
Delay(300)
If ElapsedMilliseconds() > Timeout
AbortMail(0) ; <-- Does not exist?!
Break
EndIf
Until Progress = #PB_Mail_Finished Or Progress = #PB_Mail_Error
If Progress = #PB_Mail_Finished
MessageRequester("Information", "Mail correctly sent !")
Else
MessageRequester("Error", "Can't sent the mail !")
EndIf
Or why not a Timeout parameter directly in the SendMail()-Function?
As you walk on by, Will you call my name? Or will you walk away?
Well it might do it, but I am not sure - should be confirmed by @Fred. I'd prefer a real AbortMail() function that then gives #PB_Mail_Aborted as return value of MailProgress()
As you walk on by, Will you call my name? Or will you walk away?
Would be a good to add, but it mightn't be necessary as the rfc says
There are circumstances, contrary to the intent of this
specification, in which an SMTP server may receive an indication that
the underlying TCP connection has been closed or reset. To preserve
the robustness of the mail system, SMTP servers SHOULD be prepared
for this condition and SHOULD treat it as if a QUIT had been received
before the connection disappeared.