Okay, after some debugging I realized the mistake was with the name being passed as an argument in Attachment(...)
. The second argument should recieve the name of the file with the extension (e.g. "file.txt"), and my variable, ma.FileName
, only had the name by itself. So even if I specified the MIME type in the third argument, the method didn't know the type of file it's supposed to handle. Or at least Outlook didn't.
att = new Attachment(new MemoryStream(ma.FileContent), ma.FileName + ma.FileType, ma.FileType.GetMimeType());
Adding the extension solved the problem.