[PHP-dev 1184] Re: PHP4.4.1でmb_send_mailの第5引数が利かなくなってる

Y.Watanabe haward99 @ yahoo.co.jp
2005年 11月 5日 (土) 15:55:04 JST


渡辺です。

Rui Hirokawa wrote on 2005/11/05 14:23
with Subject: [PHP-dev 1183] Re: PHP4.4.1でmb_send_mailの第5引数が利かなくなってる

> mb_send_mail()については、改行コードに\nがハードコードされている
> ところやヘッダが長い場合の折り返しについて問題点として指摘されて
> いた気がしますが、具体的にはどんな問題だったでしょうか?

んー、ごめんなさい。改行コードのことは気づいてませんでした。
mb_send_mail()で日本語Subjectが文字化けするのは
次のような場合でした。

<?php
mb_language("Japanese");
mb_internal_encoding("EUC-JP");
$to = "hoge @ example.com";
$subject = "[ほげ]ふが"; // "ほげふが"でも同様
$body = "てすと";
mb_send_mail($to,$subject,$body);
?>

上のコードをCLIで実行して、本文はOKですが題名はこんな感じで文字化け。
  Subject:  {RuL
MIMEエンコードされた形跡すらありませんでした。

以下、phpinfo()です。(一部略)


PHP Version => 4.4.1

System => Linux myhost.example.net 2.4.20-31.9
Build Date => Nov  2 2005 15:08:21
Configure Command =>  './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-pgsql=/usr/local/pgsql' '--enable-mbstring' '--with-gd' '--with-png-dir=/usr/lib' '--with-jpeg-dir=/usr/lib' '--with-zlib' '--enable-xslt' '--with-iconv' '--with-xslt-sablot=/usr/local'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/lib/php.ini
PHP API => 20020918
PHP Extension => 20020429
Zend Extension => 20050606
Debug Build => no
Zend Memory Manager => enabled
Thread Safety => disabled
Registered PHP Streams => php, http, ftp, compress.zlib  


This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies


 _______________________________________________________________________


Configuration

PHP Core

Directive => Local Value => Master Value
allow_call_time_pass_reference => On => On
allow_url_fopen => On => On
always_populate_raw_post_data => Off => Off
arg_separator.input => & => &
arg_separator.output => & => &
asp_tags => Off => Off
auto_append_file => no value => no value
auto_prepend_file => no value => no value
browscap => no value => no value
default_charset => EUC-JP => EUC-JP
default_mimetype => text/html => text/html
define_syslog_variables => Off => Off
disable_classes => no value => no value
disable_functions => no value => no value
display_errors => On => On
display_startup_errors => Off => Off
doc_root => no value => no value
docref_ext => no value => no value
docref_root => no value => no value
enable_dl => On => On
error_append_string => no value => no value
error_log => no value => no value
error_prepend_string => no value => no value
error_reporting => 2039 => 2039
expose_php => Off => Off
extension_dir => ./ => ./
file_uploads => On => On
gpc_order => GPC => GPC
highlight.bg => #FFFFFF => #FFFFFF
highlight.comment => #FF8000 => #FF8000
highlight.default => #0000BB => #0000BB
highlight.html => #000000 => #000000
highlight.keyword => #007700 => #007700
highlight.string => #DD0000 => #DD0000
html_errors => Off => Off
ignore_repeated_errors => Off => Off
ignore_repeated_source => Off => Off
ignore_user_abort => Off => Off
implicit_flush => On => Off
include_path => .:/usr/local/lib/php => .:/usr/local/lib/php
log_errors => On => On
log_errors_max_len => 1024 => 1024
magic_quotes_gpc => On => On
magic_quotes_runtime => Off => Off
magic_quotes_sybase => Off => Off
max_execution_time => 0 => 120
max_input_time => 60 => 60
open_basedir => no value => no value
output_buffering => 0 => 1
output_handler => mb_output_handler => mb_output_handler
post_max_size => 2M => 2M
precision => 12 => 12
register_argc_argv => On => On
register_globals => Off => Off
report_memleaks => On => On
safe_mode => Off => Off
safe_mode_exec_dir => no value => no value
safe_mode_gid => Off => Off
safe_mode_include_dir => no value => no value
sendmail_from => me @ localhost.com => me @ localhost.com
sendmail_path => /usr/sbin/sendmail -t -i  => /usr/sbin/sendmail -t -i 
serialize_precision => 100 => 100
short_open_tag => Off => Off
SMTP => localhost => localhost
smtp_port => 25 => 25
sql.safe_mode => Off => Off
track_errors => Off => Off
unserialize_callback_func => no value => no value
upload_max_filesize => 2M => 2M
upload_tmp_dir => no value => no value
user_dir => no value => no value
variables_order => EGPCS => EGPCS
xmlrpc_error_number => 0 => 0
xmlrpc_errors => Off => Off
y2k_compliance => Off => Off

ctype

ctype functions => enabled

gd

GD Support => enabled
GD Version => bundled (2.0.28 compatible)
GIF Read Support => enabled
GIF Create Support => enabled
JPG Support => enabled
PNG Support => enabled
WBMP Support => enabled
XBM Support => enabled

iconv

iconv support => enabled
iconv implementation => glibc
iconv library version => 2.3.2

Directive => Local Value => Master Value
iconv.input_encoding => ISO-8859-1 => ISO-8859-1
iconv.internal_encoding => ISO-8859-1 => ISO-8859-1
iconv.output_encoding => ISO-8859-1 => ISO-8859-1

mbstring

Multibyte Support => enabled
Japanese support => enabled
Simplified chinese support => enabled
Traditional chinese support => enabled
Korean support => enabled
Russian support => enabled
HTTP input encoding translation => enabled
Multibyte (japanese) regex support => enabled

                                        mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.                                        

Directive => Local Value => Master Value
mbstring.detect_order => no value => no value
mbstring.encoding_translation => On => On
mbstring.func_overload => 0 => 0
mbstring.http_input => auto => auto
mbstring.http_output => EUC-JP => EUC-JP
mbstring.internal_encoding => EUC-JP => EUC-JP
mbstring.language => Japanese => Japanese
mbstring.substitute_character => no value => no value



PHP-dev メーリングリストの案内