You must specify a MIME type in email. You can use application/octet-stream
to specify it should be handled as a binary file, text/plain
for a text file or you can make your as application/vnd.yourcompany.yourapplicationname
- anything that starts with type/vnd.company
are reserved for private use. See the Wikipedia article for more info.
Apparently, Amazon restricts both file extensions and MIME types. I would consider zipping your custom format as apparently that is allowed. See the developer documentation for more.
var inputfile = "foobar.aaa";
var tempdir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
var outZipFile = File.GetTempFileName();
File.Move(inputfile, tempdir);
ZipFile.CreateFromDirectory(tempdir, outZipFile);
Directory.Delete(tempdir, true /* delete the file within */);
var attachment = new Attachment(outZipFile, "yourFile.zip", "application/octet-stream");
// send your email
File.Delete(outZipFile);