Skip to main content

Posts

Showing posts with the label code to send email from ax with attachment

code to send email from ax with attachment in MSDAX

This is the code to send email from axapta with attachment.You can write this code in method of any class and simple call it. InteropPermission IntCPermission = new InteropPermission(InteropKind::ComInterop); InteropPermission IntCPermission1 = new InteropPermission(InteropKind::ClrInterop); InteropPermission IntCPermission2 = new InteropPermission(InteropKind::DllInterop); str body,mailto, mailfrom; System.Net.Mail.AttachmentCollection attachementCollection; str FileName; FileIOPermission FilePerm; SysMailer mailer; SysEmailParameters parameters = SysEmailParameters::find(); ; try { IntCPermission.assert(); mailer = new SysMailer(); if (parameters.SMTPRelayServerName) { mailer.SMTPRelayServer(parameters.SMTPRelayServerName, parameters.SMTPPortNumber, parameters.SMTPUserName, SysEmailParameters::password(), parameters.NTLM); } else { mailer.SMTPRelayServer(parameters.SMTPServerIPAddress,...