Good news; we already fixed the underlying limitation here and made it more flexible.
Bad news: it's fixed in 8.1.22 and up.
See this thread for more context:
And more details on how it works are in system.net.sendEmail:
https://docs.inductiveautomation.com/display/DOC81/system.net.sendEmail