I want to get the extension of the file in the attatchement not sure how to do this, below is my code, in the mailMessage.Add im adding input stream, file name how do i add extension? below is my code
if (unauthenticatedEnquiryViewModel.File != null) // this finds overall null
{
foreach (var file in unauthenticatedEnquiryViewModel.File) // loop through every File
{
if (file != null) //Finds induvidual null
{
mailMessage.Attachments.Add(new Attachment(file.InputStream, file.FileName, file.);
mailMessage.Body = mailbuilder.ToString();
}
}
}