$D and $M are only used in URLs. The body of the email with contain the text:
Syslog message generated from device DEVICE: MESSAGE
In addition to any other text you want. If you want a more flexible email, you can use the Automated Action script instead. We used to ship a sampleEmailScript.pl script with LMS 2.2 that could still be used, or you can write your own email gateway script.
The script is passed two arguments, the name of the device and the message text respectively.