は、次のコードが実行されます。
$file_content =& $file; // buffered file
$this->_attachments[] = array(
'name' => array($file, $newname),
'disposition' => empty($disposition) ? 'attachment' : $disposition, // Can also be 'inline' Not sure if it matters
'type' => $mime,
'content' => chunk_split(base64_encode($file_content)),
'multipart' => 'mixed'
);
chunk_split(base64_encode($file_content))
我々は$this->email->attach()
関数に渡されるbase64ファイルが壊れます。私は
$file_content =& $file; // buffered file
$file_content = ($this->_encoding == 'base64') ? $file_content : chunk_split(base64_encode($file_content));
にコードを変更するよう
今アタッチメント配列はよう:私は電子メールをintialzedとき
$this->_attachments[] = array(
'name' => array($file, $newname),
'disposition' => empty($disposition) ? 'attachment' : $disposition, // Can also be 'inline' Not sure if it matters
'type' => $mime,
'content' => $file_content,
'multipart' => 'mixed'
);
今:
$config['_bit_depths'] = array('7bit', '8bit','base64');
$config['_encoding'] = 'base64'
$this->load->library('email',$config);
は私がやっているかもしれませ間違った方法ですが、それは動作します。
$this->email->attach($base64,'attachment','report.pdf','application/pdf');
ダウンロード変更された電子メールクラス:
https://github.com/aqueeel/CI-Base64EmailAttach
はではSwiftMailer、phpmailerのように、あなたのために、添付ファイル、HTML形式のメールなどを扱うサードパーティの電子メールのライブラリがあります。 – bumperbox