By default, Email functions block execution (in Windows and Linux). Which means that no other code can be run during their execution. The program will resume only when the current Email functions have been run.
WEBDEV gives you the ability you to manage the emails in asynchronous mode. This mode allows your sites to send emails without locking the other processes.
To use the asynchronous mode, you must:
- Uncheck "Disable the email spooler" in the WEBDEV administrator ("Configuration" tab).
- Enable the asynchronous mode when starting the SMTP session (with EmailStartSMTPSession or EmailStartSession).
- All outgoing emails will be transmitted to a "spooler". Emails are queued up before being sent.
Executing Email functions does no longer block the rest of the program. EmailStatus
is used to determine the status of an email.
Remark: If the WEBDEV administrator is closed, the email spooler is cleared: pending emails are not sent and are removed from the spooler.
If there are pending emails, and the "Disable the email spooler" option is checked, the emails will not be lost: the administrator continues to send them, but the spooler will not accept any new emails.
: The asynchronous mode can only be used when starting a session on an SMTP server (EmailStartSMTPSession
for sending emails or EmailStartSession
). The asynchronous mode is ignored in all other cases.