27 function addAttachment(
$file, $c_type =
'application/octet-stream', $name =
'', $isfilename =
true, $encoding =
'base64', $cid =
'', $charset =
"UTF-8", $language =
'',
$location =
'', $n_encoding = null, $f_encoding = null,
$description =
'')
29 $filedata = ($isfilename ===
true) ? $this->_file2str(
$file) :
$file;
30 if ($isfilename ===
true) {
37 return PEAR::raiseError(
'The supplied filename for the attachment can\'t be empty');
39 if (PEAR::isError($filedata)) {
43 $this->_parts[] = array(
46 'charset' => $charset,
48 'encoding' => $encoding
53 function addAttachmentInline(
$file, $c_type =
'application/octet-stream', $name =
'', $isfilename =
true, $encoding =
'base64', $cid =
'', $charset =
"UTF-8")
55 $filedata = ($isfilename ===
true) ? $this->_file2str(
$file) :
$file;
56 if ($isfilename ===
true) {
63 return PEAR::raiseError(
'The supplied filename for the attachment can\'t be empty');
65 if (PEAR::isError($filedata)) {
69 $this->_parts[] = array(
72 'charset' => $charset,
74 'encoding' => $encoding,
75 'disposition' =>
'inline',
91 $params[
'content_type'] =
$value[
'c_type'];
92 $params[
'encoding'] =
$value[
'encoding'];
93 $params[
'dfilename'] =
$value[
'name'];
94 $params[
'filename'] =
$value[
'name'];
95 $params[
'charset'] =
$value[
'charset'];
97 if (isset(
$value[
'disposition'])) {
98 $params[
'disposition'] =
$value[
'disposition'];
100 $params[
'disposition'] =
'attachment';
103 if (isset(
$value[
'cid'])) {
104 $params[
'cid'] =
$value[
'cid'];
107 if (isset(
$value[
'name_encoding'])) {
108 $params[
'name_encoding'] =
$value[
'name_encoding'];
110 $params[
'name_encoding'] =
'quoted-printable';
113 if (isset(
$value[
'filename_encoding'])) {
114 $params[
'filename_encoding'] =
$value[
'filename_encoding'];
116 $params[
'filename_encoding'] =
'quoted-printable';
119 $obj->addSubpart(
$value[
'body'], $params);
123 parent::Mail_mime($crlf);
124 $this->_build_params[
'html_charset'] =
'UTF-8';
125 $this->_build_params[
'text_charset'] =
'UTF-8';
126 $this->_build_params[
'head_charset'] =
'UTF-8';
137 if (isset($params[
'filename'])) {
138 $this->_filename = $params[
'filename'];
139 } elseif (isset($params[
'dfilename'])) {
140 $this->_filename = $params[
'dfilename'];
143 parent::Mail_mimePart($body, $params);
152 if (!property_exists(
'Mail_mimePart',
'_body_file') && isset($params[
'body_file'])) {
154 $body = file_get_contents($params[
'body_file']);
155 unset($params[
'body_file']);
158 return $this->_subparts[count($this->_subparts) - 1];
163 if (!property_Exists(
'Mail_mimePart',
'_body_file')) {
165 $this->_body = file_get_contents(
$file);
167 $this->_body_file =
$file;
& addSubpart($body, $params)
Fdl_Mail_mimePart($body= '', $params=array())
addAttachmentInline($file, $c_type= 'application/octet-stream', $name= '', $isfilename=true, $encoding= 'base64', $cid= '', $charset="UTF-8")
addAttachment($file, $c_type= 'application/octet-stream', $name= '', $isfilename=true, $encoding= 'base64', $cid= '', $charset="UTF-8", $language= '', $location= '', $n_encoding=null, $f_encoding=null, $description= '')
& _addAttachmentPart(&$obj, $value)
__construct($crlf="\r\n")