I had a request from a customer and did a little investigation into it. They wanted to be able to send an ah-doc report to a customer via email. When you specify the report print parameters you just have a subject line. They wanted to be able to add some message body text. Here is a quick walk through of what that ended up like.
If I had more time there are probably a few things I’d do, one for example be able to select the email template as that they could attach pre-defined “boiler plate” messages. As well as you can see in the walk through this specific function is a client side call to Outlook still using COM. This doesn’t work in a batch process so changing this to a batch process similar to some of the other email sending functional in AX would be useful. See my earlier post on what I mean by client/server.
If you want to have a look at the code sample for R3 you can find it here
There is a model file and a XPO for the project, it should be quite similar for R1/R2. It’s a sample only for you to learn and experiment with for your own modification.
Follow-Up post here with additional parameters https://organicax.com/2015/04/20/send-report-via-email-additional-parameters/