Thread

Index > Scribe > Validating email properties before sending with a script
Author/Date Validating email properties before sending with a script
fret
06/01/2022 11:20am
If you want to check that an email has certain things before you send it, this script show you how. Specifically it'll check there is a valid subject as an example.

function CheckSubject(Application, Email)
{
    if (Email.Subject == NULL)
    {
        MessageDlg(Application, "Email has empty subject.", Application.Name, 0);
        return false;
    }

    return true;
}

function Main(App)
{
    if (!AddCallback("OnBeforeMailSend", "CheckSubject"))
        MsgBox(App, "Couldn't add hook for CheckSubject");
    return 1;
}
Reply