                 return "image/bmp"
             }
         }
-
+        
         var fileExtension: String {
             switch self {
             case .jpeg2000:
-                return ImageFormat.jpeg.rawValue
+                return NSBitmapImageRep.FileType.jpeg.mimeType.components(separatedBy: "/").last!
             default:
-                return rawValue
+                return mimeType.components(separatedBy: "/").last!
             }
         }
     }

    /// - Parameters:
    ///   - image: The `NSImage` to be attached to the message.
    ///   - named: The name used to identify this attachment in the message.
    ///   - type: The `NSBitmapImageFileType` identifying the type of image as JPEG or a PNG.
    ///   - inline: Indicates whether the image should be inlined or not (false by default)
    public func add(image: NSImage, named name: String, type: ImageFormat, inline: Bool = false) {
        let mimeType = type.mimeType
        let imgRep = image.representations.first!
        let data = imgRep.representation(using:type, properties:[:])!

        // Append extension if needed
        let filename = name.hasSuffix(".\(type.fileExtension)") ? name : name + ".\(type.fileExtension)"
        if inline {

        }
    }
#elseif os(macOS)
    extension NSBitmapImageRep.FileType {
        var mimeType: String {
            switch self {
            case .tiff:
