Outlook mail attachment file name error

While sending outlook mail with attachment, attachment file name is going with entire file path (eg: D:\sai\App.pdf), i need only file name with extension (eg: App.pdf)

HI @Sai_K

Welcome to community!

path.GetFileName(Your file path)

This will get you the filename alone
image

Regards
Sudharsan

Hi @Sai_K

Try with this syntax in the Attachment Collection

It will send all the file in the folder, with the extension .PDF

Directory.GetFiles("C:\Users\Dell\Documents\UiPath\Test\",".pdf")

Regards
Gokul

Hi @Sudharsan_Ka @Gokul001

Thanks for you both, for me that “App” varies, so i have created a variable (eg: file) to it & by using assign activity created another variable given the path “D:\sai"+file+”.pdf" & given it in the send mail attachments property.
Those two are also correct & in this way also it solved.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.