发附件问题,mb_send_mail不可以,mail可以,为啥?
很着急啊,
求解。
谢谢先
以下是我的程序:
$from .= ;
$to .= ;
$subject = 添付ファイルテスト ;
$body = 添付ファイルテスト正文 ;
$filename = /work/cgi-bin/prs/test.txt ;
$att_files = /work/cgi-bin/prs/テストファイル.txt ;
//$mine = js ;
//send_mail2($to, $subject, $text_body, $headers, $html_body= , $att_names= , $att_files= , $file_types= );
/*
if ($filename){
($attach = file_get_contents($filename)) or die( open error: $filename );
$filename = basename($filename);
$ret = attach_mail($from, $to, $subject, $body, $filename, $attach, $mine);
}else{
}
*/
$ret = send_mail($to, $from, $subject, $body, $cc = null, $bcc = null, $filename);
//echo $ret;
function send_mail($to, $from, $subject, $body, $cc = null, $bcc = null, $attachment = null)
{
if ($to != && isset( $to ) ) {
$to =str_replace( , , $to ) ;
$to =str_replace( \t , , , $to ) ;
}
if ($cc != && isset( $cc ) ) {
$cc =str_replace( , , $cc ) ;
$cc =str_replace( \t , , , $cc ) ;
}
if ($bcc != && isset( $bcc ) ) {
$bcc =str_replace( , , $bcc ) ;
$bcc =str_replace( \t , , , $bcc ) ;
}
// 念の為、言語と文字コードの設定
$body = bcc:$bcc\r\n$body\r\n ;
$body = cc:$cc\r\n$body\r\n ;
$to_tmp = join( \r\n ,explode( , ,$to));
$body = to:$to_tmp\r\n$body\r\n ;
mb_language( japanese );
mb_internal_encoding( euc-jp );
mb_detect_order( ascii, jis, utf-8, euc-jp, sjis );
// from を変換
//$fromname = mb_encode_mimeheader(mb_convert_encoding($fromname, 'jis ', 'auto '));
//$header .= 'from: '.$fromname. ' '. \r\n ;
$to = [email protected] ;