title: Send email with email attchments
body: <p>I am attempting to send an email that has attachments. 
  The exception: "Failure sending email"
  The inner exception: "Cannot access a closed stream"</p>
  
  <pre><code>MailMessage mm1 = new MailMessage();
  mm1.IsBodyHtml = true;
  mm1.Body = "Body for person to approve";
  mm1.Subject = "Home Owner's Insurance Policy";
  mm1.From = new MailAddress("insurance@email.com", "ReplyName");
  mm1.ReplyTo = new MailAddress("insurance@email.com");
  mm1.To.Add("ross.kriel@email.co.za");
  
  foreach (NewBusinessData item in lData)
  {
  
      MailMessage mm = new MailMessage();
      mm.IsBodyHtml = true;
      mm.Body = HTMLBody;
      mm.Subject = "Home Owner's Insurance Policy";
      mm.From = new MailAddress("insurance@email.com","ReplyName");
      mm.ReplyTo = new MailAddress("insurance@email.com");
  
     byte[] thisAttachment;
     thisAttachment = Common.Attach(Settings.Default.NewBusinessCSFDataFileWriterPath + item.PolicyNumber + "_" + item.MortgageLoanAccountNumber + ".pdf");
  
      Stream ClientPDF = new MemoryStream(thisAttachment);
  
      Attachment attStaticPDF = new Attachment(StaticPDF, "Home Owner's Insurance Policy.pdf");
      Attachment attClientPDF = new Attachment(ClientPDF, item.PolicyNumber + ".pdf");
      mm.Attachments.Add(attStaticPDF);
      mm.Attachments.Add(attClientPDF);
  
      Assembly assembly = typeof(SmtpClient).Assembly;
      Type mailWriterType = assembly.GetType("System.Net.Mail.MailWriter");
      using (MemoryStream stream = new MemoryStream())
      {
           ConstructorInfo mailWriterContructor = mailWriterType.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, null, new[] { typeof(Stream) }, null);
           object mailWriter = mailWriterContructor.Invoke(new object[] { stream });
           MethodInfo sendMethod = typeof(MailMessage).GetMethod("Send", BindingFlags.Instance | BindingFlags.NonPublic);
           sendMethod.Invoke(mm, BindingFlags.Instance | BindingFlags.NonPublic, null, new[] { mailWriter, true, true }, null);
  
           Attachment emailAtt = new Attachment(stream, "Home Owner's Insurance Policy.msg");
  
           mm1.Attachments.Add(emailAtt);                                                    
       }                                                                                                                                                                    
   }
   SmtpClient smtp1 = new SmtpClient();
   smtp1.Host = "HostIP";
   smtp1.Port = 25;
   try
   {
       smtp1.Send(mm1);
   }
   catch (Exception exd)
   {
       Console.WriteLine(exd.ToString());
   }
  </code></pre>