japanese email subject encoding

后端 未结 9 1570
天命终不由人
天命终不由人 2020-12-15 08:02

Aparently, encoding japanese emails is somewhat challenging, which I am slowly discovering myself. In case there are any experts (even those with limited experience will do)

9条回答
  •  难免孤独
    2020-12-15 08:54

     \n";
    $headers .= "Reply-To: " .
           "".mb_encode_mimeheader (mb_convert_encoding($from_name,"ISO-2022-JP","AUTO")) ."" .
           "<".$from_email."> \n";
    
    
    $headers .= "Content-Type: text/plain;charset=ISO-2022-JP \n";
    
    
    /* Convert body to same encoding as stated
    in Content-Type header above */
    
    $body = mb_convert_encoding($body, "ISO-2022-JP","AUTO");
    
    /* Mail, optional parameters. */
    $sendmail_params  = "-f$from_email";
    
    mb_language("ja");
    $subject = mb_convert_encoding($subject, "ISO-2022-JP","AUTO");
    $subject = mb_encode_mimeheader($subject);
    
    $result = mail($to, $subject, $body, $headers, $sendmail_params);
    
    return $result;
    }
    

提交回复
热议问题