title: Downloading Email Attachments with Python - When there's more than one attachment
body: <p>I have code that searches through a group Outlook inbox based on a certain criteria and retrieves the date and time of emails satisfying the specified criteria. This code also downloads the first attachment in the email.</p>
  
  <pre><code>import win32com.client
  from datetime import date, timedelta
  import os
  
  
  outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
  
  inbox = outlook.GetDefaultFolder(18).Folders.Item("xxx")
  messages = inbox.Items
  
  path = os.path.expanduser("C:\\Users\\User\\Documents"
                            "\\Projects\\Python Projects\\Email Classification\\Email Attachments")
  
  
  dateHigh = date.today() - timedelta(days=45)
  dateLow = date.today() - timedelta(days=-0)
  subject = "xxxxxxxx"
  
  max = 100000
  for count, message in enumerate(messages):
      if count &gt; max:
          break
      if subject in message.subject and message.senton.date() &gt; dateHigh and message.senton.date() &lt; dateLow:
         print(message.senton.date())
         print(message.senton.time())
         print(message.subject)
         attachments = message.Attachments
         attachment = attachments.Item(1)
         for attachment in message.Attachments:
             if attachments.Count &gt; 0:
                 attachment.SaveASFile(path + '\\' + str(attachment))
             break
  </code></pre>
  
  <p>What I expected was for the email attachment (pdf/csv) files to be downloaded and stored, however, only images from the emails are being downloaded. How do I download other attached files in the email?</p>