HOWTO: Sending mail from AX using .NET Framework.

Sometimes happen that SysMailer class (using CDO) is not the right solution for sending mails with attachments. There is a little sample of X++ Job that is using System.Net.Mail namespace to achieve same. static void JobNETSendMail(Args _args) { System.Net.Mail.MailMessage mailMessage; System.Net.Mail.Attachment attachment; System.Net.Mail.AttachmentCollection attachementCollection; System.Net.Mail.SmtpClient smtpClient; System.Net.Mail.MailAddress mailAddressFrom; System.Net.Mail.MailAddress mailAddressTo; str strBody; str strSMTPServer; str…

2