美文网首页
Ax 使用outlook 发送邮件

Ax 使用outlook 发送邮件

作者: axxxxxxxx | 来源:发表于2018-04-10 16:20 被阅读0次

    Ax 使用outlook 发送邮件
    https://technet.microsoft.com/en-us/library/aa834374.aspx

    https://community.dynamics.com/ax/b/yasirsmicrosoftdynamicsaxworkshop/archive/2012/07/31/sending-email-through-outlook-in-dynamics-ax

    static void sendEmialbyOutlook(Args _args)
    {
            
        Description255             recipientEmail;
        Notes                            emailBody;
        Description255             subjectText;
        Filename                       fileName;
        SmmOutlookEmail         smmOutlookEmail = new SmmOutlookEmail();
      
        recipientEmail = "receivedEmail@126.com";
        subjectText     = "Test Email";
        fileName          = @"C:\Users\chloel\Documents\1-Files\0-sql\APadjust.sql";
        emailBody       = "Hi,\nThis is a test email for Dyanmics AX.\nThanks.";
      
        if (smmOutlookEmail.createMailItem())
        {
            smmOutlookEmail.addEMailRecipient(recipientEmail);
            smmOutlookEmail.addSubject(subjectText);
            smmOutlookEmail.addFileAsAttachment(fileName);
            smmOutlookEmail.addBodyText(emailBody);
            smmOutlookEmail.sendEMail(smmSaveCopyOfEMail::No,false);
        }
        else
        {
            error("Could not communicate with Microsoft Outlook Client.");
        }
    
    }
    

    相关文章

      网友评论

          本文标题:Ax 使用outlook 发送邮件

          本文链接:https://www.haomeiwen.com/subject/ksjnhftx.html