I have been very disappointed with the voicemail emailing capabilities of Asterisk PBX. If you need to use a SMTP host, it can be a time consuming task to configure sendmail, postfix, etc, to use an external SMTP provider. And once you get the emails to send, customizing and scripting is very limited.
I wanted to be able to use SMTP, add BCC and CC recipients, have full scripting control over the message body and subject, and attach the voicemail recording in the e-mail. It seemed like writing a script and using the ‘mailcmd’ setting in the [general] section of the asterisk voicemail.conf file was a suitable way to handle this, so I took this route.