SyntaxHighlighter. all (); news & nbsp; | & nbsp; Security & nbsp; | & nbsp; Forum & nbsp; | & nbsp; download & nb
Parts = array (); $ this-> to = ""; $ this-> from = ""; $ this-> subject = ""; $ this-> body = ""; $ this-> headers = "";}/** void add_attachment (string message, * [string name], * [string ctype]) *? Why? N) join? Part object */function add_attachment ($ message, $ name = "", $ ctype = "application/octet-stream ") {$ this-> parts [] = array ("ctype" => $ ctype, "message" => $ message, "encode" => $ encode, "name" => $ name);}/** void build_message (array part) * create multipart? Parts? Information section */function build_message ($ part) {$ message = $ part ["message"]; $ message = chunk_split (base64_encode ($ message )); $ encoding = "base64"; return "Content-Type :". $ part ["ctype"]. ($ part ["name"]? "; Name = "". $ part ["name"]. """:""). "Content-Transfer-Encoding: $ encoding $ message";}/** void build_multipart () * Create a multipart? Component */function build_multipart () {$ boundary = "B ". md5 (uniqid (time (); $ multipart = "Content-Type: multipart/mixed ;". "boundary = $ boundary ". "This is a MIME encoded message. -- $ boundary "; for ($ I = sizeof ($ this-> parts)-1; $ I >=0; $ I --) {$ multipart. = "". $ this-> build_message ($ this-> parts [$ I]). "-- $ boundary";} return $ multipart. "--";}/** string get_mail ()*? Q: What is done by M? Component */function get_mail ($ complete = true) {$ mime = ""; if (! Empty ($ this-> from) $ mime. = "From:". $ this-> from. ""; if (! Empty ($ this-> headers) $ mime. = $ this-> headers. ""; if ($ complete) {if (! Empty ($ this-> to) $ mime. = "To: $ this-> to"; if (! Empty ($ this-> subject) $ mime. = "Subject: $ this-> subject";} if (! Empty ($ this-> body) $ this-> add_attachment ($ this-> body, "", "text/plain"); $ mime. = "maid: 1.0 ". $ this-> build_multipart (); return $ mime;}/** void send () * sent? Letter (last ?? Called function) */function send () {$ mime = $ this-> get_mail (false); mail ($ this-> to, $ this-> subject, "", $ mime );}}//?? E? Bundle?>