You can use the SysInetMail class to send mail from AX. The example below also uses the Email Group setup in CRM
Public void EmailNotifyList(smmEmailGroupId _listName,str _subject, str _text)
{
EmplTable emplTable;
EmplId _emplId;
smmEmailMembers emailList;
sysInetMail sysInetMail = new sysInetMail();
;
while select emailList index hint GroupIdx
where emailList.GroupId == _listName
{
_emplId = emailList.EmplId;
if (_emplId)
if (emplTable::find(_emplId).Email)
sysInetMail.sendMail(emplTable::find(_emplId).Email,_subject,_text, false);
}
}
No comments:
Post a Comment