Home > X++ stuffs > Sending Quick Email From Dynamics Ax

Sending Quick Email From Dynamics Ax

I would like to share a simple concept which most of us would have come across at least once when working on Dynamics Ax

These days we use mail  to communicate with our business partner. To be more user friendly ERP, AX has already implemented two such classes by which Email can be sent directly without using Office Application.

 

Classes that are used for Sending Email in AX are:

 

v     SysInetMail

v     ccSysInetMail

 

Where ccSysInetMail extends the parent Class “SysInetMail”. By using the below example mail is sent via Outlook to the destination.

Note: Outlook needs to be configured properly so as to send/receive any mails.

 

Sending Quick Email

static void Quick_Mail(Args _args)

{

            ccSysInetMail  ccSysInetMail;

;

            ccSysInetMail = new ccSysInetMail ();         

//Parameters 
//public void sendMail(str name, str subject, str text, boolean dialog)

            ccSysInetMail.sendMail(‘xyz@microsoft.com’, ‘Hi’, ‘Ax Mail’, true);

}

 

Sending Mail Attachments

static void Quick_MailAttachements(Args _args)

{

            ccSysInetMail  ccSysInetMail;

;

            ccSysInetMail = new ccSysInetMail ();    

//Parameters
//public void sendMailAttach (str _toName, str _ccName, str _subject, str _text, 
boolean _dialog, str _attachPath,[str _attachName])

            ccSysInetMail.sendMailAttach (‘xyz@microsoft.com’, ‘abc@hotmail.com’, ‘Test Project’, ‘Please find the attached XPO’, true, ‘C:\AIF\TstPrj’);

}

 

Happy Mailing E-mail from AX

Advertisements
Categories: X++ stuffs
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: