-

  • (3)
  • (2)
  • (1)
  • (1)
  • (0)

 -

   php

 - e-mail

 

 -

 LiveInternet.ru:
: 20.09.2007
:
:
: 41

:

.


: (1), (2), (0), (3)
(0)

PHP

, 13 2007 . 14:17 +
MniD (php) PHP :

:
PHP:

$from 
"admin"//  
$to "tiger1989@mail.ru"// 
$filename "certificates/image.jpg"//   
$subj 'TIGER IMAGE'//  
$text 'Hello from tigercms.com'//  
$f fopen($filename,"rb"); //      $filename
$un strtoupper(uniqid(time()));
$head "From: $fromn"//    
$head .= "To: $to ";
$head .= "Subject: $subj ";
$head .= "X-Mailer: PHPMail Tool ";
$head .= "Reply-To: $from ";
$head .= "Mime-Version: 1.0 ";
$head .= "Content-Type:multipart/mixed;";
$head .= "boundary="----------".$un."" ";
$zag "------------".$un." Content-Type:text/html; ";
$zag .= "Content-Transfer-Encoding: 8bit $text ";
$zag .= "------------".$un." ";
$zag .= "Content-Type: application/octet-stream;";
$zag .= "name="".basename($filename)."" ";
$zag .= "Content-Transfer-Encoding:base64 ";
$zag .= "Content-Disposition:attachment;";
$zag .= "filename="".basename($filename)."" ";
$zag .= chunk_split(base64_encode(fread($f,filesize($filename))))." "//  
//  base64,       "chunk_split"

mail("$to""$subj"$zag$head); //    mail()
font>



.

.

, , .





 : [1]