In Some special cases when i can't use a tool and must write mine and as you said want to make loops through the template.
I create a normal aspx page in my project and put there all the controls i need "server controls, databinding controls"
And then call this page using a silent call:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("MyASPXPage.aspx");
request.Method = "GET";
response = request.GetResponse();
reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
result = reader.ReadToEnd();
after that you will have the result string variable contain all the page which you can send as a mail.
I used this once and it worked nice.
But sure if you found a tool to help you in that, this will be better.