I want to format attachment info as a string with File Name and File Size
I can get FileName in Attachments.ContentDisposition
, but Size is null
. Is any other way to get?
Eg : string.Join(',' + Environment.NewLine, mailData[i].Attachments.ToList().Select(y => y.ContentDisposition.FileName + '(' + y.ContentDisposition.Size.ToString() + ')').ToList())
Example output i want :
xxx.jpg(123 bytes),
xxx.png(456 bytes),
xxx.pdf(123456 bytes),