Monday, 20 January 2014

How to send email through ax 2012

public void mail()
        {
            CustComlaint       _custComlaint;
            sysMailer          sysmailer;
            Email              emailID;
            ID                 id;
            sysemailparameters parameter = sysemailparameters::find();
            InteropPermission  _interopPermission;
            ;
            sysmailer = new sysmailer();
            _interopPermission = new InteropPermission(InteropKind::ComInterop);
            _interopPermission.assert();
            select reverse _custComlaint;
                ID      = _custComlaint.ID;
                emailID = _custComlaint.Email;
            sysmailer.quickSend("anant.dubey@s3infotech.in",
                                 emailID,
                                 "Complaint Request",
                                 strFmtLB("Dear Sir, your complaint has been received & your complaint number is" +"-"+strFmt('%1',id)));
}

No comments:

Post a Comment