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, ...
Unanswered

create outlookmail and open it

(0) ShareShare
ReportReport
Posted on by 625

Hi

Is there a way to create an outlook email by code and open it (NOT SENDING)

The sending should be done manually

I have the same question (0)
  • WillWU Profile Picture
    22,361 on at

    Hi CRSW,

    Please refer to the following article:

    community.dynamics.com/.../sending-email-through-outlook-in-dynamics-ax

    Hope this helps.

  • kvnkk Profile Picture
    800 on at

    use below code ..

    have tested and working fine for me..

    static void mail_from_ax(Args _args)
    {
    Description255 recipientEmail;
    Notes emailBody;
    Description255 subjectText;
    Filename fileName;
    SmmOutlookEmail smmOutlookEmail = new SmmOutlookEmail();

    recipientEmail = "test@gmail.com";
    subjectText = "Test Email";

    emailBody = "Hi,\nThis is a test email for Dyanmics AX.\nThanks.";

    if (smmOutlookEmail.createMailItem())
    {
    smmOutlookEmail.addEMailRecipient(recipientEmail);
    smmOutlookEmail.addSubject(subjectText);
    smmOutlookEmail.addBodyText(emailBody);
    smmOutlookEmail.sendEMail(smmSaveCopyOfEMail::Yes,NoYes::Yes);
    }
    else
    {
    error("Could not communicate with Microsoft Outlook Client.");
    }

    }

    result :-.

    pastedimage1577789182891v1.png

  • kvnkk Profile Picture
    800 on at

    use below code ..

    have tested and working fine for me..

    static void mail_from_ax(Args _args)
    {
    Description255 recipientEmail;
    Notes emailBody;
    Description255 subjectText;
    Filename fileName;
    SmmOutlookEmail smmOutlookEmail = new SmmOutlookEmail();

    recipientEmail = "test@gmail.com";
    subjectText = "Test Email";

    emailBody = "Hi,\nThis is a test email for Dyanmics AX.\nThanks.";

    if (smmOutlookEmail.createMailItem())
    {
    smmOutlookEmail.addEMailRecipient(recipientEmail);
    smmOutlookEmail.addSubject(subjectText);
    smmOutlookEmail.addBodyText(emailBody);
    smmOutlookEmail.sendEMail(smmSaveCopyOfEMail::Yes,NoYes::Yes);
    }
    else
    {
    error("Could not communicate with Microsoft Outlook Client.");
    }

    }

    result :-.

    6177.pastedimage1577789182891v1.png

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 584 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 254 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans