public static void sendEmail(str _fileName, str _subject, str _body, System.IO.MemoryStream _memoryStream, Email _fromEmail, Email _toEmail) { SysMailerMessageBuilder mailer = new SysMailerMessageBuilder(); try { mailer.setSubject(_subject); //mailer.setFrom(_fromEmail); mailer.setBody(_body); mailer.addTo(_toEmail); mailer.addAttachment(_memoryStream, _fileName); SysMailerFactory::sendNonInteractive(mailer.getMessage()); Info("@SYS58551"); } catch (Exception::CLRError) { System.Exception ex = ClrInterop::getLastException(); if (ex != null) { ex = ex.get_InnerException(); if (ex != null) { error(ex.ToString()); } } } catch (Exception::Error) { Error("@ErrorOccurredFailedSendEmail"); } }
This blog is contains coding reference related to Microsoft AX 2012 and D365 finance and operations and Power platform
Friday, December 1, 2023
Send email X++
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment