UiPath not able to save outlook attachments

Dear community,

I have a problem with the follwing scenario:

Scenario:

The attachment from a specific mail (searched by subject) should be stored in a local folder

Steps to reproduce:

Current Behavior:

No Error, but the attachment wont be saved if the process is executed. It seems that there is a problem during the reading process, because the mail does not show any content.

Expected Behavior:

The process is built like in the tutorial video → file should be saved in the selected folder

Studio/Robot/Orchestrator Version: 2017.1.6435

Last stable behavior:
Last stable version:

OS Version: Win7 64bit

Others if Relevant: (workflow, logs, .net version, service pack, etc):

Hi,
Could you please attach workflow?
Did you check onlyUnreadMessages property?

Hi,

the onlyUnreadMessages property is not set!
please find the workflow:
receive_attachment_mail.xaml (9.1 KB)

here you can see how the received mail appears in outlook:

and here the Mail when it is save via the “Save Mail Message” function. As you can see there is no attachment:

Hi,
Looks all fine for me.
Executed and i can see the attachment in saved mail.

Just one silly qn are you sure you opening same mail which has attachment.:thinking:
Because you have given count 10 read mail to process and in save mail message activity you just passed name as test.eml which lead to save the last mail message in the outlook (which is probably don’t have attachment) hence you don’t see the attachment in save mail message activity.
Could you please try this keeping count as 1 which has attachment and try to run the code.

PS: if you want all the mailmesssage to save with/without attachment(as it is) then add counter like tes1.eml,test2.eml and so on.

Hi,

the save mail function is currently used to check if there is an attachment in the mail or not. In the „productive environment“ these function won’t be used anymore. The important function is the “save Attachments” and it does not save the attachment.

As you can see in the workflow, the attachment/the mail should only be saved if the subject of the mail contains the word “Zeiten” and there is only one mail in the inbox (within the first 10 mails) that fits to this condition. I have also started debug mode and the behavior of the “if function” worked perfect. It was looping several times (10) and jumped to the Sequence (“Save Attachment” and “Save Mail”) when the condition “Zeiten” was fulfilled.
The problem is, when I am checking the folder, no attachment is saved there…

I hope you can follow my explanation… :relaxed:

Thank you and kind regards
David

1 Like

Hi,
To find out if Mail has attachments or if it has no attachment you can try this:
“Item.Attachments.Any”. You need not to use any save attachment/mail activity.
Not sure why its not working.:no_mouth:
Could please try saving attachment\mail without putting condition.(discard if condition )
by keeping count 1.

Hi,
I have tried it without the if condition and count is 1, but the same result. No attachment is saved and the saved mail looks like → see below.

I have tried the function “Item.Attachments.Any” as well and the result is “false“ –> so it seems that there is no attachment in the mail, but it definitely is.
Is it possible that UiPath is not able to read mails due to reasons like security or something like that? Do you know this kind of problem?

[/uploads/default/original/2X/f/f33d987e140e05ce7833e71b0f2f70d4919b7bcb.gif]

@qateam

under investigation, we will come back with an answer

3 Likes

Ok, thank you very much.

Hi guys,

any news to the issue?

Thank you and regards
David

Hi guys,

I am also experiencing the same issue where “Save Attachment” activity is not saving the attachment files. I’m using Outlook 2016.

I have a colleague on older version of Outlook and the “Save Attachment” activity works on his Outlook.

Hello! I have the same problem… I attach the uipath file in the shorter link above. Do you have any idea? It seems a basic activity, so I don’t understand if I have made some mistake. Thank you
FILE → https://ufile.io/5igpx

I am also expericncing the same issue but in Gmail no error n no attachment saved.Can anyone please help me?

Hi, @Arooshi

Mine is okay. My requirement is the same, fetch the email with subject containing “AUDIT” and save the attachment - though I don’t need to save the email itself as I am only after the attachment.

This is currently my flow:

  1. I used assign value so I create new folder everyday
    "D:\UIPATH\Audit\Data Files\Audit " +DateTime.Now.Date.ToString(“dd-MM-yyyy”)
    assign%201
  2. I added a checker if file path exist, otherwise will create as the user wanted to run it multiple times in a day.
    Path%20Exist

folder%20exist
3. Then, I used the Get outlook mail message with the following filter:
“@SQL= urn:schemas:httpmail:hasattachment=true AND urn:schemas:httpmail:subject like ‘%audit%’”
You may refer to this link for other filter you can use: Chapter 11: Searching Outlook Data | Microsoft Learn
4. I use for each to save the filtered emails’ attachment in the folder I created earlier.
Save%20attachment

Let me know if this helps.

Regards,
Mharlieee

7 Likes

Hi,

I’m also facing the same problem with gmail. I have actually checked, whether the mails have attachments. For some reason it looks like Uipath cannot see the attachments in certain mails, although the attachment is definitely there. When I log the data of the mails, it says that the there are zero attachments for the mails, where the attachment download doesn’t work.

For other mails the attachments are downloaded normally.

Is is possible that UiPath could check this issue again? I cannot see any understandable reason as to why some mail attachments are detected by uipath and some not.

Best regards,
An RPA developer

2 Likes

Hi @RPA_tester

Could you please check if this happens only with blank attachments? Also, what UiPath.Mail.Activities pack version do you have?

Thanks,
Viorela

Hi,
I am having the same issue. Did you find any solution.

Hi Ovi,
mail activities version - 1.1.6562.21018

I am trying to read an excel attachment in mail. I am reading emails using IMAP. When i read the original email, it says no attachments. How ever, when i forward the same email and try to read it. I am able to save the attachments.

Hi all,

Don’t know if this have been solved yet. I found that if outlook has not been opened before the attachments won’t save, so I added 2 steps: open and close outlook. Attachments are saving fine afterwards. Hope this helps.