Sending a mail through X++

Hi,
Fill the necessary email parameters that are required to send a mail in AX.

Go to Administration(Module) > Set up > Email parameters.

Untitled

Use below code to send a mail through X++ with attachment:
static void c_SendQuickMail(Args _args)
{
//str ToAddress = “chaitanya.k@dhanushinfotech.net”;
str FromAddress = “chaitanya.k@dhanushinfotech.net”;
str Subject = “New2”;
str Body = “Hi”;
str FileToAttach = “D:\\fn.pdf”;
SysMailer mailer = new SysMailer();
;
mailer.ccs().appendAddress(“chaitanya.k@dhanushinfotech.net;ramakrishna.k@dhanushinfotech.com”);
mailer.quickSend(fromaddress,”chaitanya.k@dhanushinfotech.net”,subject,body,””,FileToAttach);
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

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