note 69129 added to function.mail
| From: | thomasatp-deviondotde at osu1 dot php dot net | Date: | Thu, 24 Aug 2006 05:46:58 +0000 |
| Subject: | note 69129 added to function.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-116248@lists.php.net to get a copy of this message | ||
Change the function addattachment for multipartmail to auto detect the mime_content_type ...
function addattachment($file){
$fname = substr(strrchr($file, "/"), 1);
$data = file_get_contents($file);
$i = count($this->parts);
$content_id = "part$i." . sprintf("%09d", crc32($fname)) .
strrchr($this->to_address, "@");
$this->parts[$i] = "Content-Type: ".mime_content_type($file).";
name=\"$fname\"\r\n" .
"Content-Transfer-Encoding: base64\r\n" .
"Content-ID: <$content_id>\r\n" .
"Content-Disposition: inline;\n" .
" filename=\"$fname\"\r\n" .
"\n" .
chunk_split( base64_encode($data), 68, "\n");
return $content_id;
}
----
Server IP: 66.163.161.117
Probable Submitter: 91.64.166.39
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.mail.php
Edit -- https://master.php.net/note/edit/69129
Del: integrated -- https://master.php.net/note/delete/69129/integrated
Del: useless -- https://master.php.net/note/delete/69129/useless
Del: bad code -- https://master.php.net/note/delete/69129/bad+code
Del: spam -- https://master.php.net/note/delete/69129/spam
Del: non-english -- https://master.php.net/note/delete/69129/non-english
Del: in docs -- https://master.php.net/note/delete/69129/in+docs
Del: other reasons-- https://master.php.net/note/delete/69129
Reject -- https://master.php.net/note/reject/69129
Search -- https://master.php.net/manage/user-notes.php