title: How to get Attachment value from "$File" Item? using C# (Lotus Notes)
body: <p>I am trying to access Attachment names form "$File" (Lotus Notes).</p>
  
  <pre><code> NotesView inbox = _serverDatabase.GetView("($Inbox)");
   NotesDocument docInbox = inbox.GetFirstDocument(); 
  
   NotesItem file = docInbox.GetFirstItem("$File");
  
   String fileType = file.type.ToString(); 
  </code></pre>
  
  <p>( getting fileType value "ATTACHMENT" for mail containing attachments)</p>
  
  <p>I am not getting solution given in:</p>
  
  <p><a href="https://stackoverflow.com/questions/1361695/how-to-access-attachments-from-notes-mail">How to Access attachments from Notes mail?</a></p>
  
  <p>I got solution as:</p>
  
  <pre><code>object[] items = (object[])docInbox.Items; 
  
  foreach (NotesItem nItem in items)
  
  {
  
    if (nItem.Name == "$FILE")
     {
  
       NotesItem file = docInbox.GetFirstItem("$File");   
  
       string fileName = ((object[])nItem.Values) [0].ToString();
  
       NotesEmbeddedObject attachfile = (NotesEmbeddedObject)docInbox.GetAttachment(fileName);
  
       if (attachfile != null)
        {
          attachfile.ExtractFile("C:\\test\\" + fileName);
        }
   } 
  </code></pre>
  
  <p>But here I am getting only first attachment value.
  Can anyone help me out in this?</p>