02.11.2010, 18:05 | #1 |
Участник
|
dynamics-ax-dev: Sending Emails From Dynamics AX without Outlook
Источник: http://dynamics-ax-dev.blogspot.com/...x-without.html
============== Recently we had a need to have Dynamics AX send emails without the use of Outlook. I was presented with the following blog by Mohammed Rasheed titled Sending Emails From Dynamics AX without Outlook, which proved to be extremely useful. There was however an issue with the code (perhaps simply related to our environment) which was puzzling. The problem was that the email would send successfully, but afterward, an error was thrown stating: ClrObject static method invocation errorThe line of code that appeared to be the culprit was basically the last line in the function: CodeAccessPermission::revertAssert();However, after analyzing things more closely the problematic line was actually the line just above: winApi::deleteFile(fileNameforEmail); // delete temp fileAs it turns out, the deleteFile() function was failing because the file had not been released by a previous process. Though it was a bit painful to figure out what was going on, the solution itself was rather simple. Immediately after sending the email, I modified the code to dispose the objects that may have been clinging to the file mymail.Send(mailmessage);After this, the file was released, and was able to be deleted, and the error went away! Источник: http://dynamics-ax-dev.blogspot.com/...x-without.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|