     {
         if let mimeType = part.mimeType
         {
-            result = result + "Content-Type: " + mimeType + "; name=" + filename + "\n"
-            result = result + "Content-Disposition: attachment; name=" + filename + "\n"
-            result = result + "Content-Transfer-Encoding: base64\n"
+            result = result + "Content-Type: " + mimeType + "; name=" + filename + "\r\n"
+            result = result + "Content-Disposition: attachment; name=" + filename + "\r\n"
+            result = result + "Content-Transfer-Encoding: base64\r\n"
         }
     }
     else
     {
-        result = result + "Content-Type: text/plain\n"
+        result = result + "Content-Type: text/plain\r\n"
     }
     
     return result

    if part.body != nil
    {
        result = result + bodyPartHeaders(part: part)
        result = result + "\n"
        result = result + bodyPart(part: part)
    }
    else
    {
        let boundary = makeBoundary()
        result = result + multipartHeaders(part: part, boundary: boundary)
        result = result + "\n"
        result = result + multipart(multi: part, boundary: boundary)
    }
    

{
    var result = ""
    
    result = result + boundary
    
    for part in multi.parts!
    {
        result = result + "\r\n"
        
        result = result + partToRFC2822(part: part)
        
        result = result + "\r\n"
        
        result = result + "--" + boundary
    }

    result = result + "--\r\n"
    
    return result
}
