Skip to main content
Navigator | Tier 3
December 3, 2023
Solved

Email reply for those emails who have an attachment only. 

  • December 3, 2023
  • 6 replies
  • 376 views

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
    Navigator | Tier 3
    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!

    Abhay Naik
    Shusha321Author
    Navigator | Tier 3
    December 5, 2023

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

    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
    Automation Anywhere Team
    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!

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

    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!

    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.