Populating list of items in Email body
<p>I am trying to populate list of items in my email body through my emial setup class.
 When i am trying to open email in my outlook, i can see just see one item where i am expecting list of items.</p>

<p>Below is my code :</p>

<pre><code> public class EmailSetup
{
    string toEmailSetup = string.Empty;
    string fromEmailSetup = string.Empty;
    string domainName = string.Empty;
    string emailServer = string.Empty;

    public void ApplicationFailedEmailSetup(List&lt;string&gt;ApplicationsInactive,DateTime dateRun)
    {
        toEmailSetup = ConfigurationManager.AppSettings["To mailid"];
        fromEmailSetup = ConfigurationManager.AppSettings["From mailid"];
        domainName = ConfigurationManager.AppSettings["Domain Name"];
        emailServer = ConfigurationManager.AppSettings["Email Server"];
        try
        {
            var messager = new MailMessage();
            messager.To.Add(toEmailSetup);
            messager.Subject = "Applications Crashed/Closed";
            messager.From = new MailAddress(fromEmailSetup);
            try
            {
                messager.Body = "Following applications you are monitoring are closed are crashed:";
                **foreach (var item in ApplicationsInactive)
                {
                    messager.Body = item;
                }**  // Here i am trying to populate list of applications.
            }
            catch (Exception)
            {
              throw;
            }

            var smtp = new SmtpClient(emailServer);
            smtp.EnableSsl = true;

            try
            {
                smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
                smtp.UseDefaultCredentials = false;
                smtp.Send(messager);
            }
            catch (Exception)
            {

                throw;
            }

        }
        catch (SmtpException ex)
        {
            throw new ApplicationException
               ("SmtpException has occured: " + ex.Message);
        }

    }

}
</code></pre>
