I was just researching on the emailing capabilities in D365 and found that SysINetMail, SysMailer and some of the smmOutlook classes are deprecated because these classes used predominantly client-side technologies that are no longer available
Below is the quick code snippet that can be used in D365 to send emails. Please note, this is just a untested sample code, with out any setups configured. please ensure all setups are done and improvise the code accordingly.
SysMailerFactory class internally used SysImailer* classes to send emails.
public static void main(Args _args)
SysMailerMessageBuilder messageBuilder = new SysMailerMessageBuilder();
FromEmail = "email@example.com";
toEmail = "firstname.lastname@example.org";
messageBuilder.setBody("Hello from D365", false);
messageBuilder.setSubject("Email Test from D365");
// Note: not calling setFrom() defaults to the current user for SMTP client, whereas
// when sent to Outlook any setFrom() value will be ignored since profiles on the client are used
// Open the generated email in the configured client
// Sends a message interactively, allowing the user to view and modify the message before
// Try using sendNonInteractive method too