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.
How to attach multiple files from desktop as attachments in send email action
Try with separating filenames with semicolon (;)
![Collaborator Badge](https://uploads-us-west-2.insided.com/automationanywhere-en/attachment/eeb1807e-43ef-49be-9d57-ee7e35651ddc_thumb.png)
I tried that but it is not sending attachment in a single mail instead it is sending seperately
Hi
Have you tried with the List option which is available in the attachment part?
![](https://uploads-us-west-2.insided.com/automationanywhere-en/attachment/9f3ede29-5ccc-4ea3-a982-123fe470bb2c.png)
![Collaborator Badge](https://uploads-us-west-2.insided.com/automationanywhere-en/attachment/eeb1807e-43ef-49be-9d57-ee7e35651ddc_thumb.png)
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.
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.
![Collaborator Badge](https://uploads-us-west-2.insided.com/automationanywhere-en/attachment/eeb1807e-43ef-49be-9d57-ee7e35651ddc_thumb.png)
I tried with this but still its not attaching multiple files inside single mail.
Please share your lines of code screenshots
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.
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.
![](https://uploads-us-west-2.insided.com/automationanywhere-en/attachment/4e058d2e-5806-4c41-8344-c4a59570c01c.png)
![](https://uploads-us-west-2.insided.com/automationanywhere-en/attachment/6ec71579-b987-4a5b-806f-ffe1a8aa8ba9.png)
Variable type to be list and subtype of that file to be file.
![Collaborator Badge](https://uploads-us-west-2.insided.com/automationanywhere-en/attachment/eeb1807e-43ef-49be-9d57-ee7e35651ddc_thumb.png)
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.
![](https://uploads-us-west-2.insided.com/automationanywhere-en/attachment/8d3a939e-68b0-4d39-9da8-c428e218992d.png)
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
![Collaborator Bronze Badge](https://uploads-us-west-2.insided.com/automationanywhere-en/attachment/fee7f4b5-b93b-4ad9-b9d0-d7e4b4be4c9a_thumb.png)
Or simply append the file paths into a string variable (comma separated) and use that string variable in the Attachment field.
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
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.
![](https://uploads-us-west-2.insided.com/automationanywhere-en/attachment/4e058d2e-5806-4c41-8344-c4a59570c01c.png)
![](https://uploads-us-west-2.insided.com/automationanywhere-en/attachment/6ec71579-b987-4a5b-806f-ffe1a8aa8ba9.png)
Variable type to be list and subtype of that file to be file.
You can refer the quoted message for dynamic add of attachments
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.