I have a scanario to download attachments in mail.
Mail have 1 PDF attachment in mail but If we check MailVariable.Attachments.count, result with be 2.
Later me check the issue, then noticed in mail body sender signature is an IMAGE.
I need download only the actual attachment need to ignore embed images in mail body, looking for exports suggetions.
I’m using OUTLOOK activity
Welcome back to our UiPath community.
It works for me.
Note: In Filter property of
Save Attachments activity mention like this "(.pdf)"
Our objective is to download all attachments ie., PDF, Excel, PNG or JPG.
But need to avoid images embed in mail body.
I think you have two options:
Option 1 - Update filter for multiple ‘approved’ types:
Further to @lakshman’s post.
In Filter property of Save Attachments activity can you try this "(.pdf|xls)"
Simply add a pipe “|” symbol when you need to add more filetypes.
Take a look here:
Save Attachments About the files extensions - News / Tutorials - UiPath Community Forum
Option 2 - Save all attachments then delete ‘not approved’ (unwanted) file types.
Step 1: Save all attachments
Step 2: Use Assign Activity to collect ALL files
Arr_Files (array of string)
Take a look at post
Step 3: Use a For Each and an IF activity to delete the “.PNG” or other unwanted file types.
You will need to download all attachments.
Hopefully this helps you.
@VISHNU07 That is Okay. Let it download the images. Once the attachment download completes check is there any files other than .pdf extension . If there are any delete those files from the folder using delete activity
@ushu and @Steven_McKeering
My scanario is I can download all types for file attached in mail, but need to ignore images embeded in mail body.
Below is my sample Mail
Robot execution log
Output Downloaded Files
In this example only the files
1,2 and 3 are required.
File 4 is from mail body, so not required.
Note: File 4 is embed in mail body
In Filter property of Save Attachments activity can you try this
As per your screenshot example, it will download files 1-3 but not 4.
Thanks for response
THe about scanario is an example, sometimes we may get other formats also in attachment.
File 4 is
png format, sometimes png format file comes as actual attacment ie. file 3 may me png format instead if jpg format.
I guess signature image name constant here. If yes then delete that file whose name starts with
Outlook-ug after saving all attachments.
Okay, I think I understand more now.
You need to remove the signature block image and keep the ‘real’ attachments. So it may not always be “.png”.
This is hard to do because it may not always be .png. But maybe you can use the file size also?
Is this correct?
Thanks, I check this before.
Its always not the same sign in file name.
Yes, your understanding is correct now.
I looking for more effective solution.
If I got any will updated you.
I would be interested in that solution too!
Can you please run the process 2 to 3 times and show me the output here. I need to check how filename looks everytime.
@VISHNU07 , I got into the same problem and haven’t found the best solution for that. But one way to solve this is to save all attachments and then loop through all attachment names.
Images embedded in mail body usually have name like “image1.img”, “image2.img”, … I used Exchange, it could be something else with Outlook in your case. I just delete all attachments with names like that (using Regex) and consider the rest of them as real attachments.
Thanks for your solution, it will work sure.
In my case, sometime i may receive image as real attachments.
If real Image attachment file name start with image*** will be removed, I need it
that’s why look our community friends suggestion.
This issue was addressed in
Uiapth Mail Activities Pack Version 1.15.1 attached r elease note link for more details.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.