/// <summary> /// Creates the email with recipients, subject, and body. /// </summary> /// <param name="ToRecipients">The recipient(s) of the email. A list of email addresses the email will be send directly to.</param> /// <param name="Subject">The subject of the email.</param> /// <param name="Body">The body of the email.</param> /// <param name="HtmlFormatted">Whether the body is HTML formatted.</param> /// <param name="CCRecipients">The CC recipient(s) of the email. A list of email addresses that will be listed as CC.</param> /// <param name="BCCRecipients">TThe BCC recipient(s) of the email. A list of email addresses that will be listed as BCC.</param> procedure Create(ToRecipients: List of [Text]; Subject: Text; Body: Text; HtmlFormatted: Boolean; CCRecipients: List of [Text]; BCCRecipients: List of [Text]) begin EmailMessageImpl.Create(ToRecipients, Subject, Body, HtmlFormatted, CCRecipients, BCCRecipients); end;
Answers
But you can also put a shared mailbox or setup a user account mail and attach that to the scenario.
I just received this notification :
"Error AL0433: Table 'SMTP Mail Setup' is removed. Reason: Moved to "Email - SMTP" app. Use SMTP connector to create SMTP accounts. Email accounts can be configured from "Email Accouts" page from "System Application".. Tag: 20.0."
isnt we cant use SMTP Mail Setup anymore?
So if you install Thst extension, found on appsource. You can use smtp emailing.
See also
https://docs.microsoft.com/en-us/dynamics365/business-central/admin-how-setup-email#legacy-smtp-settings-and-the-email---smtp-connector-extension
thanks for your url link
i managed to send using new email connector
but do you have any idea how to add cc and bcc?
Old code
New Code
i tested but i cant find how to add cc and bcc
And recipientType you can choose to, cc or bcc because it is an enum.
got it !
Thanks a lot !
but seems doesnt sent to cc email
here is my code
You must use AddRecipient
where can i find this Addrecipient?
I only can find GetRecipient
I can see in BC20 you have Addreciepient in codeunit codeunit 8904 "Email Message":
https://github.com/microsoft/ALAppExtensions/blob/main/Modules/System/Email/src/Message/EmailMessage.Codeunit.al
You can use EmailMessage.Create with this signature and pass the CC or BC that you want
Regards
I am using version 19.5
Hi @ftornero ,
it works !
thank you much !