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

@Sathish_Kumar_S

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

Hi,

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.

Thanks,
Jayesh

1 Like

@Sathish_Kumar_S
Main.xaml (8.8 KB)

  1. define attachmentList variable
    image
    image

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

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

2 Likes

Hey @Sathish_Kumar_S

Use Attachments collection please…

Thanks
#nK

1 Like

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