The problem with Google base64 encoding and PHP decrypts

Ok, I have a difficult problem. I will try to explain this clearly.

I am forwarding an email from Google to a php script. If I use the "@" character, it encodes it to base 64, as you see the example below. I can decode it, but sometimes letters do not have the "@" symbol, so it DOES NOT END IT IN EMAIL ... and if I run the base64 script in my php code all the time, it will decode it, even if it doesn’t need to spoil the text.

Meaning?

The following is an example that gets the encoding because the "@" character is used:

Example ONE I sent this: sample@sample.com ============================================= The email came out like this. Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: base64 U2FtcGxloXNhbXBsZS5jb20NCg0KLS0NClNlbnQgdXNpbmcgU01TLXRvLWVtYWlsLiAgUmVwbHkg dG8gdGhpcyBlbWFpbCB0byB0ZXh0IHRoZSBzZW5kZXIgYmFjayBhbmQgIA0Kc2F2ZSBvbiBTTVMg ZmVlcy4NCmh0dHBzOi8vd3d3Lmdvb2dsZS5jb20vdm9pY2UNCg== ------------------------------------------------------ ------------------------------------------------------ Example TWO I sent this: Hello World ====================================================== The email came like this: Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Hello world 

How to check if it is encoded, and how can I encode it correctly?

Thank you very much.

Red

0
source share
1 answer

The answer is only there, look at the following heading:

 Content-Transfer-Encoding: base64 

It tells you that the content is encoded using base64 encoding.

+2
source

Source: https://habr.com/ru/post/1384548/


All Articles