This sample application explains how to send customized emails. This could easily be extended to whatever your requirements are.