• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

发附件有关问题,mb_send_mail不可以,mail可以,为啥

php 搞代码 3年前 (2022-01-24) 20次浏览 已收录 0个评论

发附件问题,mb_send_mail不可以,mail可以,为啥?
很着急啊,
求解。
谢谢先
以下是我的程序:

<?php

$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_8本文来源gao.dai.ma.com搞@代*码(网$

搞代gaodaima码

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] “;


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:发附件有关问题,mb_send_mail不可以,mail可以,为啥

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址