status of the sent email?

Is it possible to check the status of the sent email?
Learn the script execution status, example:

/tool e-mail send to=exemple@mail.ru subject="Mikrotik" body=hello
:if (email send....) do=
:if ([ /tool e-mail get last-status ] = "succeeded") do={ ...

But I am not sure if you need a delay between sending and checking for status…

Thanks you.

With waiting loop until “in-progress” will change.

{
# Wait until other script in bg end sending e-mail now...
while ([tool e-mail get last-status] = "in-progress") do={delay 1s}
delay 2s

# Now I send my e-mail who has wrong smtp server and reach timeout...
tool e-mail send server=1.1.1.1 subject="WrongSMTP" to=name@domain.tld
while ([tool e-mail get last-status] = "in-progress") do={delay 1s}
local EMailStatus [tool e-mail get last-status]
if ($EMailStatus = "failed") do={put "ERROR"}
if ($EMailStatus = "succeeded") do={put "SUCCESS"}
}

OR

{
tool e-mail send server=1.1.1.1 subject="WrongSMTP" to=name@domain.tld
local ExitDoLoop false
while ($ExitDoLoop = false) do={
  local EMailStatus [tool e-mail get last-status];
  if ($EMailStatus = "in-progress") do={delay 1s; put "."} else={
    set $ExitDoLoop true;
    if ($EMailStatus = "failed") do={put "ERROR"}
    if ($EMailStatus = "succeeded") do={put "SUCCESS"}
  }
}
}

Thank you, SiB.

Your while loop works. However, I modified it to “do-while” in order to give a second of delay for the email to send to track its progress…

:do { :delay 1s } while=( [/tool e-mail get last-status] = "in-progress" )