"Send Exchange Mail Message" activity - only attach if file exists

Using the Send Exchange Mail Message activity, I would like to be able to dynamically attach a file if it exists, and not attach if the file does not exist. What is the best way to do this? Thanks, Mark

Handle it with If and else condition

You can use File.Exists(“Your Attachment File Path”).ToString in IF Activity if it comes True than attach or in else part you can send mail without attachment.
Hope this helps you

Thanks very much Manjula and Anshul. But I think you’re talking about maintaining two separate “Send Exchange Mail Message” activities: one with the attachments and one without. I would prefer to keep only one activity and dynamically add the attachment if the file exists. What is the process for dynamically attaching a file to a “Send Exchange Mail Message” activity? Thanks again!

use if condition to check the path, using path exists activity.
If it is true, store path in Variable ,Else nothing in Variable . After checking this condition, pass the variable value to Attachments of send outlook activity .

Thanks Azam. I’ll give that a try.