Skip to main content

Posts

Showing posts with the label Example of sending mail in dynamics Ax

Example of sending mail in MSD Ax

To send mail you can try code in following way in job . You can then set this code in your way in form or dialog . str sendereml = 'sendereml@domainname.com'; str recipienteml= 'recipient@domainname.com'; str cc1 = 'cc@domainname.com'; str subject = 'Testing'; str MailBody = 'Testing mail txt -hello how r u'; str fileName1 = @'C:\Testing1.txt'; Set permissionSet; System.Exception e; str mailServer; System.Net.Mail.SmtpClient mailClient; System.Net.Mail.MailMessage mailMessage; System.Net.Mail.MailAddress mailFrom; System.Net.Mail.MailAddress mailTo; System.Net.Mail.MailAddressCollection mailCCCollection; System.Net.Mail.AttachmentCollection mailAttachementCollection; System.Net.Mail.Attachment mailAttachment; ; try { permissionSet = new Set(Types::Class); permissionSet.add(new InteropPermission(InteropKind::ClrInterop)); permissionSet.add(new FileIOPermission(filename1, &#