Есть другие проблемы с вашим кодом, но это должно позволить вам получить несколько вложений:
import win32com.client
import os
outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
inbox = outlook.GetDefaultFolder(6) # "6" refers to the index of a folder - in this case the inbox. You can change that number to reference
messages = inbox.Items
message = messages.GetFirst()
subject = message.Subject
#
get_path = 'C:\\Users\\test\\Desktop\\resumes'
for m in messages:
if m.Subject == "FW: Opportunity with Mindtree | Automotive Infotainment |":
print (message)
attachments = message.Attachments
num_attach = len([x for x in attachments]))
for x in range(1, num_attach):
attachment = attachments.Item(x)
attachment.SaveASFile(os.path.join(get_path,attachment.FileName))
print (attachment)
message = messages.GetNext()
else:
message = messages.GetNext()