Skip to main content
Solved

Email reply for those emails who have an attachment only. 

  • December 3, 2023
  • 6 replies
  • 269 views

Forum|alt.badge.img+5

Hi, does anyone know how to send an email reply for those emails who have an attachment only. Thanks!

Best answer by Abhay Naik

Hi @Shusha321,

 

You can use the loop trough each email and store the output in the dictionary variable. Then use “emailNoOfAttachments” key to retrieve number of attachments in each email. If there us no attachment and you’ll get output as 0 and if there are attachments then it will give you number of attachments. You can then use if condition where attachment is not equal to 0 and send the reply.

 

Hope this helps!

6 replies

Abhay Naik
Forum|alt.badge.img+8
  • Navigator | Tier 3
  • Answer
  • December 3, 2023

Hi @Shusha321,

 

You can use the loop trough each email and store the output in the dictionary variable. Then use “emailNoOfAttachments” key to retrieve number of attachments in each email. If there us no attachment and you’ll get output as 0 and if there are attachments then it will give you number of attachments. You can then use if condition where attachment is not equal to 0 and send the reply.

 

Hope this helps!


Forum|alt.badge.img+5
  • Author
  • Navigator | Tier 3
  • December 5, 2023

Thank you for this @Abhay Naik I successfully run the taskbot. :) 


Forum|alt.badge.img
  • Cadet | Tier 2
  • May 21, 2024

 Hi @Abhay Naik ,

 

I´ve noticed that the “emailNoOfAttachments” key also counts attachments like pictures embedded in the email body, e.g. within the email signature. So it gives back values <> 0 although there´s no real file attached. Is there also a way to determine the number of attached files?

 

Thanks in advance!


jon.stueveapeople
Automation Anywhere Team
Forum|alt.badge.img+7

 Hi @Abhay Naik ,

 

I´ve noticed that the “emailNoOfAttachments” key also counts attachments like pictures embedded in the email body, e.g. within the email signature. So it gives back values <> 0 although there´s no real file attached. Is there also a way to determine the number of attached files?

 

Thanks in advance!

Not really, a picture in the signature is still read as an attachment in the email message 


Forum|alt.badge.img
  • Cadet | Tier 2
  • May 22, 2024

Thanks a lot @jon.stueveapeople for your quick reply!

 

Although the pictures are counted as attachments in the “emailNoOfAttachments” key, they don´t seem to be regarded as such in the “Email: Save attachments” command where only the “real” attached files are saved to a given folder. This might be something to optimize in future updates of the Email package as it doesn´t seem aligned!?! However, as a developer I found that a bit confusing… Thanks!


Forum|alt.badge.img+7
  • Navigator | Tier 3
  • May 22, 2024

Hi @Shusha321 

For this what u can do is , if you already know the format of the file that you are going to download from the Email, then u can use save attachments in the Temp folder then use each file in a folder option to filter only the file that you are looking for and delete the files that are not required.