Sending Email from AX

Below code snippet is used to send mail from AX to the desired user:

public void SendEmailNotificationTest()
{
    SysMailer mail;
    InteropPermission permission = new InteropPermission(InteropKind::ComInterop);
    str fromMail,body,sub;
    str 100 tomail;
    ;

    permission.assert();

    mail = new SysMailer();

    fromMail = "MailerId@DomainName.com"; //Take the mail Id from the Email Parameters  
                                          // in System admin\setup\system\Email Parameters
    tomail = "Receiver mail ID";
    sub="Service Warrenty PO Alert ";

    body = "Test Email body";
  
    mail.quickSend(fromMail,tomail,sub,body);
    
    info(strFmt("done!"));
}

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