bcquality/community/knowledge/architecture/prefer-email-module-over-codeunit-mail-397.bad.al
Michael Dieringer 17e8856b35 Add 4 community knowledge articles: posting-routine pattern, email module, Word report layout, defensive/offensive blast radius
Contributed from Curabis's own BCQuality custom layer, rewritten to the
community contribution contract (no fenced code in the .md, AL samples as
sibling .good.al/.bad.al files, under 100 lines per article).
2026-08-27 18:11:04 +02:00

13 lines
474 B
AL

codeunit 50130 "Contoso Send Confirmation"
{
procedure SendOrderConfirmation(FromName: Text; ToAddress: Text; Subject: Text; Body: Text)
var
Mail: Codeunit Mail;
begin
// Hard-coded to whatever SMTP account is configured; no Sent/Outbox
// record is left once this call returns.
Mail.CreateMessage(FromName, ToAddress, '', Subject, Body, true);
if not Mail.Send() then
Message(Mail.GetErrorDesc());
end;
}