//Send E-mail in AX using below Job
static void emails(Args _args)
{
SysMailer _sendMail;
Args argsRep = new Args();
Args argsInv= new Args();
Reportrun reportInv;
ReportRun reportRep;
Set permissionSet,permissionSet1;
InteropPermission perm1;
;
perm1 = new InteropPermission(InteropKind::ComInterop);
perm1.assert();
_sendMail = new Sysmailer();
// _sendMail.SMTPRelayServer(‘Server smtp/IP address’,Port no(25),’Your E-mailId,’Your password’,false);
_sendMail.SMTPRelayServer('smtp.gmail.com',587,'Kanha@gmail.com','xxxxx',false);
_sendMail.fromAddress("Kanha@gmail.com");
_sendMail.tos().appendAddress("Kanha@gmail.com");
_sendMail.ccs().appendAddress("Kanha@gmail.com");
_sendMail.subject(strfmt('Test Mail'));
_sendMail.htmlBody(strfmt('This is an automated generated Test Mail'));
_sendMail.sendMail();
info("mail sent");
}
static void emails(Args _args)
{
SysMailer _sendMail;
Args argsRep = new Args();
Args argsInv= new Args();
Reportrun reportInv;
ReportRun reportRep;
Set permissionSet,permissionSet1;
InteropPermission perm1;
;
perm1 = new InteropPermission(InteropKind::ComInterop);
perm1.assert();
_sendMail = new Sysmailer();
// _sendMail.SMTPRelayServer(‘Server smtp/IP address’,Port no(25),’Your E-mailId,’Your password’,false);
_sendMail.SMTPRelayServer('smtp.gmail.com',587,'Kanha@gmail.com','xxxxx',false);
_sendMail.fromAddress("Kanha@gmail.com");
_sendMail.tos().appendAddress("Kanha@gmail.com");
_sendMail.ccs().appendAddress("Kanha@gmail.com");
_sendMail.subject(strfmt('Test Mail'));
_sendMail.htmlBody(strfmt('This is an automated generated Test Mail'));
_sendMail.sendMail();
info("mail sent");
}
No comments:
Post a Comment