How to insert attachment in UI path SMTP activity

How to add attachment in UI path SMTP activity.
attachment is and excel file.


Hey @piyush.2224

You are asking about “Smtp send mail Activity”?

If it is so you can send multiple or even single attachment using mail collection of attachments.

For Further Assistance, Find an attachment sample and let me know in case of any doubt. (8.4 KB)



does anybody knows how to build a list of attachments dynamically? from 1 to N attachments in one single email.


@aksh1yadav I use your example but i have a doubt.

I want just choose a specif item not every files in the folder

How can i do this Please ?

Just Don’t use the for -each loop and make only use of the content inside for each-

and change the item value with your single file path in assign statement.


I’ve tried SMTP for sending attachment. It throws error has “The process cannot access the file because it is being used by another process.”


What if you close the files that you are trying to send as attachment? (ex. if you have an excel file, close it first and check if you still get the error)

Hi @ovi ,

It is already in closed state only. But still I’m getting this error. Error will not appears when commenting the Move activity.

Process: Send mail with attachment and move the file to seperate folder.

Actually the above process is working fine for sending mail through Outlook and then moving the file to Processed folder. But the same proces will not work for SMTP.

I’m iterating the file through items.


I think you have to dispose the attachments after sending the email:

Hi, I’m using SMTP. Is this same for that too?


Great, after using the Invoke method, It’s worked fine.


Got Folder not found exception executing above code,Can you help me to Add multiple files as attachments

Hello Aksh - I am faving difficulty in adding the To Address in the SMTP mail message the way you have shown it in your sample. I try something like - Assign mail.To = new MailAddress(""). Please help in this regard. Also, is there a way to send multiple attachments using outlook?


I tried this step, however I am getting error as “The given path’s format is not supported.”
Kindly help me out.

Thank you,

Hi All

I want to pick a single file checking file name contains certain string and sent it uisng outlook , not in for each, please help with some sample


Hi aksh1yadav,
I try attachment that you are provided it send mail but unable to attach the files.

Hi @aksh1yadav,

I am facing an issue while sending SMTP Mail message, the error is week authentication as shown below,

Mahesh Gundekar

Hey @mahesh.gundekar

The Problem might be with your given path. Check sample for more assistance.

It is due to Security Feature by Gmail for their accounts safety.If an app or device doesn’t meet our security standards, Google will block anyone who tries to sign in from that app or device. Because these apps and devices are easier to break into, blocking them helps keep your account safe.

So if you will access your account from the devices or methods which does not support latest security compliance which has been identified with google then you will get such error to secure your account.

so, you have two options:

  1. Option 1: Install a more secure app that uses stronger security measures. All Google products, like Gmail, use the latest security measures.

  2. Option 2: Change your settings to allow less secure apps into your account. We don’t recommend this option because it can make it easier for someone to break into your account. If you want to allow access anyway, follow these steps:



Hi @aksh1yadav,

Thanks a lot for your valuable suggestion.

Thanks & regards,
Mahesh Gundekar

Is it possible in another methd

my scenario is : i have some files in one folder. i want attach that files . How ?