How to solve the problem of garbled mail text in php
This article mainly introduces how to solve the problem of garbled mail text in php. It is very detailed and has a certain reference value. Interested friends must finish reading it!
Php mail text garbled solutions: 1, set the read data encoding mode to "UTF-8"; 2, when sending e-mail also specify the encoding mode as "UTF-8".
This article operating environment: Windows7 system, PHP7.1 version, DELL G3 computer
How to solve the problem of garbled php mail text?
The solution of Chinese garbled code in PHP mail
It's mainly about coding:
The solution is:
Set the encoding method for the read data; also specify the encoding method when sending email
First use the function base64_encode () to encode the data using MIME base64
The encoding type is preceded by the title string, for example: =? UTF-8?B?
Of course, if it is gb2312, then =? GB2312?B?
Add:? = after the title string
-mine for configuration reference-
The above is all the contents of this article entitled "how to solve the problem of garbled mail text in php". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!