Mail & Redirection
OcaltQL sends email with the MAIL verb and performs HTTP redirects with REDIRECT. Both are fire-and-forget operations — they do not return a value and do not use SET. All modifiers are optional and can appear in any order.
The MAIL verb sends an email. The body type — TEXT or HTML — is declared before BODY. All string delimiters are interchangeable. All modifiers can appear in any order.
Basic Email
MAIL TEXT BODY 'hello world' TO 'email@email.com' SUBJECT 'this is a subject'
MAIL HTML BODY '<h1>Hello</h1><p>World</p>' TO 'email@email.com' SUBJECT 'HTML message'
Recipients
Multiple recipients are comma-separated inside the TO value. CC and BCC follow the same pattern.
MAIL TEXT BODY 'hello' TO 'email@email.com, email@email.co' SUBJECT 'multi recipient'
MAIL TEXT BODY 'message' TO 'boss@site.com' CC 'team@site.com' SUBJECT 'report'
AFTER MAIL TEXT BODY 'message' TO 'boss@site.com' BCC 'secret@site.com' SUBJECT 'hidden copy'
Headers, Reply-To, and Attachments
MAIL TEXT BODY 'hello' HEADER 'From: blah@blah.com' TO 'email@email.com' SUBJECT 'with header'
MAIL TEXT BODY 'help needed' TO 'support@site.com' SUBJECT 'support' REPLY TO 'user@site.com'
MAIL TEXT BODY 'see attached' TO 'client@site.com' SUBJECT 'invoice' ATTACH '/root/invoice.pdf'
String Delimiters and Modifier Order
Double quotes, single quotes, and backticks are fully interchangeable throughout MAIL. All modifiers can appear in any order after the verb.
MAIL HTML BODY "hello" HEADER 'From: sender@site.com' TO `email@email.com` SUBJECT "subject"
MAIL TO 'a@a.com, b@b.com' SUBJECT 'test' HEADER 'X-Custom: value' TEXT BODY 'hello' CC 'c@c.com' BCC 'd@d.com' REPLY TO 'e@e.com' ATTACH '/root/file.pdf'
SET.REDIRECT
REDIRECT performs an HTTP redirect. It accepts a relative path or a full URL. The default status code is 302. Use AS to specify a different code. REDIRECT ends the script — nothing after it executes.
REDIRECT '/dashboard'
REDIRECT '/login' AS '302'
IF ?user IS NULL
OPEN
REDIRECT 'https://ql.ocalt.com/login' AS '302'
CLOSE
RUN authenticate WITH ?token SET ?valid
AFTER IF ?valid IS EMPTY
OPEN
REDIRECT 'https://ql.ocalt.com/error' AS '302'
CLOSE
OR
OPEN
REDIRECT '/success' AS '302'
CLOSE
REDIRECT are unreachable, including statements in the same chain.