Invalid value for ByteString error when calling gmail send API with base64 encoded < or>

后端 未结 5 1355
南笙
南笙 2021-01-03 22:07

Really stuck on this one and pulling my hair out trying to figure out what to do, searched everywhere and tried everything but still stuck. Any help is much appreciated.

5条回答
  •  有刺的猬
    2021-01-03 22:29

    If you are using PHP try this (otherwise try converting it to whatever language you are using)

    Call the below function on your mime message before setting it to the raw property.

    private function base64url_encode($mime) {
        return rtrim(strtr(base64_encode($mime), '+/', '-_'), '=');
    }
    

提交回复
热议问题