Solved

How to attach multiple files from desktop as attachments in send email action

  • 21 February 2023
  • 14 replies
  • 2158 views

Badge +1

I have to attach multiple files to a single mail as attachments . How to attach multiple files from desktop as attachments in send email action and send a single mail with all the attachment in it.

icon

Best answer by Zaid Chougle 23 February 2023, 10:06

View original

14 replies

Badge

Try with separating filenames with semicolon (;)

Badge +1

I tried that but it is not sending attachment in a single mail instead it is sending seperately

Userlevel 7
Badge +13

Hi @Pooja.S7 ,

 

Have you tried with the List option which is available in the attachment part?

 

Badge +1

Yes  I tried with list option only with variables in the file path. Still I am not able to attach all the files inside a single email.

 

Userlevel 5
Badge +10

@Pooja.S7 

Question

How to attach multiple files while using EWS or Outlook as mail server in Send Email in Automation 360 (formerly Automation Anywhere Enterprise A2019)?

Answer

For Outlook, attachments can be separated using semicolon (;) as the separator.

For EWS, third party jar is used. Use comma (,) as a separator to make it work.
 

Additional Information

EWS email does not support Filename/Path with Comma(,) in it. For example, "Test\\Folder1\\Folder,2\\Filename".

 

 

(OR)

Multiple files can be attached to email using ";"(semi-colon) as a separator.
Below is a sample task steps to send email with attachment.

1    Start Loop "Each File In Folder $vPath$"
2         Variable Operation: $vAttach$$vPath$$FileName$.$Extension$; To $vAttach$
3    End Loop
4    Send Email: Subject "Automation Anywhere finished executing the TaskBot" with Attachment(s).

vPath is a folder path variable like "C:\Users\Administrator\Documents\test\".
In Line 4, $vAttach$ variable can be used as attachment parameter.
 

Badge +1

I tried with this but still its not attaching multiple files inside  single mail.

Badge

Please share your lines of code screenshots

Userlevel 7
Badge +13

Yes  I tried with list option only with variables in the file path. Still I am not able to attach all the files inside a single email.

 

Ok. Then manually create a list and loop through the Folder from where you need to attach the files. Add those files into the list at the end of this loop. Try to add this list variable inside the Variable section under Send action.

Userlevel 4
Badge +10

Yes  I tried with list option only with variables in the file path. Still I am not able to attach all the files inside a single email.

 

Please refer below image of solution for sending multiple attachments in a single email.

 

Variable type to be list and subtype of that file to be file.

Badge +1

The Issue was Solved, I tried using List variable as above and then I am able to attach in to a single mail. Thanks everyone for the helping me.

Badge

but even so, it is not possible to send all the documents, it will send you a single file, in this case it will send position 0

Badge +2

Or simply append the file paths into a string variable (comma separated) and use that string variable in the Attachment field.

Badge

Adding them manually does not work for me, is there a way to attach them dynamically, for example, sometimes there may be 10 files to attach to an email, tomorrow there may be 5 and so on

Userlevel 4
Badge +10

Yes  I tried with list option only with variables in the file path. Still I am not able to attach all the files inside a single email.

 

Please refer below image of solution for sending multiple attachments in a single email.

 

Variable type to be list and subtype of that file to be file.

@CAMILO ANDRES.O 

You can refer the quoted message for dynamic add of attachments

Reply