The example below provides an insight into how this is done.
Sample: Checking casted mails
<?php
$mailer = new Mailer;
$mailer->server('mail.server'); // load server config file
$mailer->setup([
'client' => ['name' => 'Foo']
]);
$mailer->sendmail('mail.template');
if($mail->casted(!online)) {
//... mail was forwarded in while offline.
}
In the example above, the
casted() method was used to check
if attempt to send a mail was done while in offline environment. This may be
helpful in code structuring and organization.