note 54863 added to ref.mail

From: Date: Mon, 18 Jul 2005 11:37:48 +0000
Subject: note 54863 added to ref.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-92108@lists.php.net to get a copy of this message
hi all programmer this code is a simple code for attachment mail for use whitout class <?php $type = array('gif' => 'image/gif', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpe' => 'image/jpeg', 'bmp' => 'image/bmp', 'png' => 'image/png', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'swf' => 'application/x-shockwave-flash', 'doc' => 'application/x-msword', 'xls' => 'application/x-msexel', 'bilinmiyor' => '"application/x-unknown-content-type"'); $header=""; $message=""; $boundary='--' . md5( uniqid("myboundary") ); $priorities = array( '1 (Highest)', '2 (High)', '3 (Normal)', '4 (Low)', '5 (Lowest)' ); $priority=$priorities[3];//4 anlamýna geliyor yukarýda $charset="iso-8859-9"; $ctencoding="8bit"; $subject="merhaba"; $body="merhaba arkadaþlar."; $to="baristasdemir@hotmail.com"; $from="localhost"; $cc=$to; $bcc=$to; $sep= chr(13) . chr(10); $ctype=$type["bilinmiyor"]; $path[]="k9.gif"; //$path[]="kl.mp3"; $disposition="inline"; for($i=0;$i<count($path);$i++){ $message .="This is a multi-part message in MIME format.\n--$boundary\n"; $message .= "Content-Type: text/plain; charset=$charset\n"; $message .= "Content-Transfer-Encoding: $ctencoding\n\n" . $body ."\n"; $basename=basename($path[$i]); $message .="--$boundary\nContent-type: $ctype;\n name=\"$basename\"\n"; $message .="Content-Transfer-Encoding: base64\nContent-Disposition: $disposition;\n filename=\"$basename\"\n"; $linesz= filesize( $path[$i])+1; $fp= fopen( $path[$i], 'r' ); $content = chunk_split(base64_encode(fread( $fp, $linesz))); fclose($fp); $message .= $sep.$content; } //_________________________________header_____________________ $header.="From: $from\nX-Priority: $priority\nCC: $cc\n"; $header.="Mime-Version: 1.0\nContent-Type: multipart/mixed;\n boundary=\"$boundary\"\n"; //burdaki bi boþluk benim saatlerimi aldý aman dikkat boundary=\"$boundary\"\n" kýsmýnýn öneündeki boþluk kesinlikle olmalýymýþ :( :(( $header.="Content-Transfer-Encoding: $ctencoding\nX-Mailer: Php/libMailv1.3\n"; //_________________________________header_____________________ mail($to,$subject,$message."\n",$header); ?> ---- Manual Page -- http://www.php.net/manual/en/ref.mail.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+54863 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54863&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54863&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54863&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54863&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54863&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54863&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+54863&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#92108) next »