Skip to main content
Cadet | Tier 2
February 21, 2023
Solved

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

  • February 21, 2023
  • 16 replies
  • 4170 views

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.

Best answer by Zaid Chougle

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.

16 replies

Cadet | Tier 2
February 21, 2023

Try with separating filenames with semicolon (;)

Pooja.S7Author
Cadet | Tier 2
February 21, 2023

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

Padmakumar
Premier Pathfinder | Tier 7
Premier Pathfinder | Tier 7
February 21, 2023

Hi @Pooja.S7 ,

 

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

 

Padmakumar
Pooja.S7Author
Cadet | Tier 2
February 21, 2023

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.

 

rbkadiyam
Premier Pathfinder | Tier 7
Premier Pathfinder | Tier 7
February 21, 2023

@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.
 

Ramesh B Kadiyam
Pooja.S7Author
Cadet | Tier 2
February 22, 2023

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

Cadet | Tier 2
February 22, 2023

Please share your lines of code screenshots

Padmakumar
Premier Pathfinder | Tier 7
Premier Pathfinder | Tier 7
February 23, 2023

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.

Padmakumar
Zaid Chougle
Navigator | Tier 3
Navigator | Tier 3
February 23, 2023

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.

Lets Automate !
Pooja.S7Author
Cadet | Tier 2
March 7, 2023

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.