File name by email sender name

Hi guys how do write if i want to file name to be base on the email sender name ?
image

Hi @xiangyun.koh

Try this

email.Sender.DisplayName

Regards,

@xiangyun.koh

Then in name field use System.Text.RegularExpressions.Regex.Replace(email.from.Address,"[^a-zA-Z0-9]")

This will ensure email id is used and all special characters are removed in name to remove any conflicts in name

Cheers

Hi @xiangyun.koh

Assign: senderName = currentItem.From.DisplayName
Assign: validFileName = Regex.Replace(senderName, "[^a-zA-Z0-9]", "_") + ".msg"

image

Hope it helps!!

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