web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Send Email in X++ using Email Template

(0) ShareShare
ReportReport
Posted on by 10

Once PO is created and confirmed, create invoice, however user will not be able to match a product receipt, when user clicks ok and saves the invoice, the system should send the following information to the user to complete the product receipt. System will send alert via email that user is trying to post invoice without receiving the product receipt and ask the user to receive the product receipt. System will trigger this event when user clicks the ‘Ok’ button, additionally there will be a ‘Send alert for product receipt button’ on the action pane to trigger this event as well.

I have the same question (0)
  • MuthukumaranAX Profile Picture
    2,903 on at

    can you let us know what is the issue?

  • Suggested answer
    Danial47 Profile Picture
    142 on at

        public static void main(Args _args)

        {

            SysMailerMessageBuilder messageBuilder = new SysMailerMessageBuilder();

            Email   toEmail;

            Email   fromEmail;

            try

            {

                FromEmail = “sreddy@xyzcompany.com”;

                toEmail   = “tester@xyzcompany.com”;

                messageBuilder.setBody(“Hello from D365”, false);

                messageBuilder.setSubject(“Email Test from D365”);

                messageBuilder.addTo(toEmail);

                // 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

                messageBuilder.setFrom(fromEmail);

                // Open the generated email in the configured client

                // Sends a message interactively, allowing the user to view and modify the message before

                SysMailerFactory::sendInteractive(messageBuilder.getMessage());

                // Try using sendNonInteractive method too

            }

            catch (Exception::Error)

            {

                throw error(“@SYS33567”);

            }

    }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans