Mail > Save attachment not saving the attachments

Hello folks,

I am facing an issue with the “Save Attachments” activity.

Input: several emails, al of them having an identical format/template, all of them have 2 .PDF attachments.

Expected output: 2 saved attachments for each processed email

Error: The attachments are not saved every time. One email may be processed okay, another one may may have no attachments downloaded.

Tried so far:

  • updating the UiPath activities
  • updating Studio to the latest version
  • creating/testing this “Save attachment” in a different project
  • tinkering with the “Get outlook mail message” and “Save attachments” activities (tried all the properties)
  • looking through the email headers, they are almost identical

“Exclude inline attachments” has nothing to do with the error I’m getting

The activities are the same every time, nothing changes, but the attachments are sometimes saved, sometimes nothing happens.

Picture 1:

Picture 2:

This is how the emails look like - they are all the same:

@AlexGabriel97

Does it error out or nothing like that?

Is it happening for any specific emails?

Can you write a count of attachments and what are present so that we can see if they are present

Cheers

Hello @Anil_G

No errors are thrown when I use the “Save Attachments” activity.
This is the error that I get when I try to extract the attachment’s name:

mailMessages(0).Attachments.Count.ToString gets me the value “0” while my email has 2 attachments. They can be saved manually, the .PDFs can be open with no issues.
I tried this with several emails:
image
While others are processed just fine
image

@AlexGabriel97

Can you confirm the mail package version…and the studio version

And yes when attachments are not there the name would be null hence the error…

This was observed before but was resolve in 1.13.1 version and studio 22.4

Cheers

All the dependencies are up to date and the studio runs on 2022.12.0. This error was happening even before I updated all the dependencies

Hey,
I guess for some mails there is no attachments is attached, we can loop through them and check if mailMessages.attachments.any then only we can download the attachment.
Also if possible we can filter the mails using subject.
Can you please try this one and let us know?
Regards.

Hello @Ganesh_Dongre

image

I understand your point of view but unfortunately I can’t avoid or delete these emails.
According to the IT team in my company, these emails are identical and have almost identical headers. The only variable are the 2 attached .PDFs but those ARE NOT corrupt documents, I don’t understand why Studio won’t let me process them. Bear in mind that these .PDFs are already manually downloaded and used by the company’s employees.

My guess is there is a bug withing Studio and I trying to find a workaround.

Dear @AlexGabriel97 ,

Can you cross check if the subject of that mail and the attachment? then only we can conclude the bug.

anyone could solve this issue?

Hi, please go through this document, It may help you.