When quot;, if you force the specified file name when adding an attachment... A friend who uses PHPMailer to send an email may encounter garbled characters when carrying the Chinese attachment name. next I will introduce a solution. for example, the attachment we want to send is "test .txt ", if you force the specified file name when adding an attachment:
$ Mail-> AddAttachment ($ attach, $ attach );
The file name of the uploaded attachment will be garbled, if not specified:
$ Mail-> AddAttachment ($ attach, $ attach );
Then, the Chinese characters in the file name sent in the past are gone and become ". txt ".
Solution: If you want to set the file name to Chinese, provide the Chinese name parameter (the second parameter) when calling AddAttachment. for example, the code is as follows:
$ Mail-> AddAttachment ('temp/2011/test.rar ', 'Test .rar ');
Other questions: when sending a Chinese email, garbled characters may occur in Chinese. I checked the source code. the garbled characters are generated by converting the Mail title into several smaller ones =? UTF-8? B ?...? =, It may have accidentally truncated the Chinese characters, so my modifications are simpler and a little gentle. modify the 1,185th rows:
$ Maxlen = 75-7-strlen ($ this-> CharSet); changed:
$ Maxlen = 75000-7-strlen ($ this-> CharSet );
Address:
Reprinted at will, but please attach the article address :-)