Download Email Attachements buuuuut

**Download and save attachments from unread mails. **
But: always the same sender and always the same file name (Zipfile)

Hello Community, I am an absolute rookie and need your help:

I get emails several times a day from the same sender. In this mail is an updated attachment to the previous one, or a completely new one. However the sender and the ZIP folder in the attachment is always the same Name.

The task is to retrieve all mails in the evening and download the attachment from each mail, sort it from old to new and then copy it into a folder. Each ZIP must be unpacked one by one and the content copied to the destination folder.

I fail to give the attachments from the mail a timestamp for differentiation purpose and to create the right order.

Look forward to your support
AJ

What have you accomplished so far?

  1. Retrieve all mails in the evening with always the same sender and always the same file name
  2. Download the attachment from each mail
  3. Sort it from old to new and then copy it into a folder.
  4. Each ZIP must be unpacked one by one and the content copied to the destination folder.

Hi vvaida,

well i know how to set up the activity get mail, but because it is just one an the same Sender ID and the same Name of the attachment, i believe the activity thinking it is just one mail. So from 5 new mails with attachments, the activity is saving only one attachment. This is my main problem, everything else i figure out.

many thanks for the summary.

Answering your Question:

3 & 4 are done in short time after solve my main problem 1&2

cheers
Aleks

Since the attachment name is same, it seems to be overwriting the previous save. You can try renaming the attachment names to be unique before saving:

att.Name = att.Name+"_"+now.ToString("MMddyyhhmmssff")+".zip"

Type Argument for Inner foreach

image

1 Like

Hey Vvaida,

Yeeeeeeah :smiley: it works perfect for me…
Well done, good Idea with the second “for each” loop. Very beautiful and logically solved Vvaida.

Have now the problem that the process chain is to fast for outlook. I Put a Delay with one second in the Body of the first “for Each”

Now it runs perfect

Great!!!

Thank You very much for Your Support Vaida!

Cheers Aleks