Get the App
SLTechnology News&Howtos  ›  Development  › 

How to solve the problem of garbled mail text in php

Shulou Source: shulou.com Published: 2022-06-03 15:23:07 11月14日 Update

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!

Tags: Coding garbled mode text question data content method character string time title article email UTF-8 reference value interest function guy Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Microsoft MariaDB Redmi OPPO Reno