Send Exchange Mail Message: Value cannot be null. Parameter name: fileName

I have a common workflow to send notification email… Which i will invoke in different places in project.

Only in few places , it will required to send attachments.

I have added attachment argument and In exchange activity properties in attachments field the argument in placed

Since attachment won’t be required or available for some places in workflow…
I can’t provide any value for in_attachment argument.

How do i keep use same “Send notification.xaml” for both attachment and without attachment?

Here is the workflow:

1 Like


In Send Notification workflow, use IF activity and check whether attachment has any value or not. If yes then pass attachment argument value to Send Exchange Mail Message activity else not. It should be something like this.

      IF Not String.IsNullOrEmpty(in_Attachment.Trim)
      Then Send mail with attachment
      Else Send mail without attachment
1 Like


Use IF or flow switch condition.

Just use two send exchange mail activity. One is with attachment and other is without attachment.

Based on condition bot will execute the expected activity.


1 Like

Main.xaml (8.8 KB)

  1. define attachmentList variable

  2. if not string.IsNullOrEmpty(in_Attachment)
    then assign attachmentList = in_Attachment.Split(","c).ToList

  3. pass attachment list to send outlook mail message attachmentsCollection property


Hey @Sathish_Kumar_S

Use Attachments collection please…


1 Like

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