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

{
  // Example: Content-Type: multipart/mixed; boundary=001a1142881cd25a87054971dde2
    
  return "Content-Type: multipart/mixed; boundary=" + boundary + "\n"
}

func bodyPart(part: GTLRGmail_MessagePart) -> String


func makeBoundary() -> String
{
    let length = 20
    let bytes = [UInt32](repeating: 0, count: length).map { _ in arc4random() }
    let data = Data(bytes: bytes, count: length)
    return GTLREncodeWebSafeBase64(data)!
}

func headerToRFC2822(header: GTLRGmail_MessagePartHeader) -> String
{
    return header.name! + ": " + header.value! + "\r\n"
}

func bodyPartHeaders(part: GTLRGmail_MessagePart) -> String
