Thursday, July 26, 2012

Sending email through outlook in Dynamics AX

Question:
How can i send an email in AX through outlook?

Answer:

static void OutlookEmail(Args _args)
{
    SmmOutlookEmail smmOutlookEmail = new SmmOutlookEmail();

    ;
    if (smmOutlookEmail.createMailItem())
    {
        smmOutlookEmail.addEMailRecipient('asamad@moorestephens.com.au');
        smmOutlookEmail.addSubject("Test");
        smmOutlookEmail.isHTML(true);
        smmOutlookEmail.addBodyText('Test');
        smmOutlookEmail.sendEMail(smmSaveCopyofEmail::No);
    }
}

No comments:

Post a Comment