- $mail->addattachment ($attach, $attach);
Copy CodeSending past attachment filenames will be garbled if not specified:
- $mail->addattachment ($attach, $attach);
Copy CodeSent in the past in the file name of the Chinese directly without, became ". txt". Workaround One Open class.phpmailer.php, in about the 1007th row or so, the function addattachment, there is a sentence:
- $filename = basename ($path);
- if (false = = = Strpos ($path, '/'))
- $filename = $this->encodeheader ($path);
- Else
- $filename = $this->encodeheader (substr ($path, Strrpos ($path, '/') + 1));
Copy CodeSolution II If you want to set the file name to Chinese, provide the Chinese name parameter (the second parameter) when calling AddAttachment. Like what
- $mail->addattachment (' Temp/2011/test.rar ', ' Test. rar ');
Copy CodeOther questions: When sending Chinese mail, Chinese will appear garbled Garbled generation is probably in the mail header into a few small =?utf-8? B?...? = when it is possible to inadvertently cut the Chinese to produce, modify the 1185th line:
- $maxlen = 75-7-strlen ($this->charset);
Copy CodeChange to:
- $maxlen = 75000-7-strlen ($this->charset);
Copy CodeAttached, Phpmailer Mail Send class V5.1 download address. |