<form action="mailto:URL" method=POST>

解决方案 »

  1.   

    <form action="mailto:[email protected]" method=POST type=plain/mime>就可以了,
      

  2.   

    说错了以下
    <form action="mailto:[email protected]" method=POST enctype="text/plain">
      

  3.   

    晕,这几天大家都在发email,呵呵
    这是贴第三次了,附件没有做上,你自已改改吧,如果没有附件的话这样就可以用
    <FORM METHOD=POST ACTION="">
    发送给谁:<INPUT TYPE="text" NAME="name"><br>
    标题:<INPUT TYPE="text" NAME="title"><br>
    内容:<TEXTAREA NAME="content" ROWS="10" COLS="50"></TEXTAREA><br>
    <INPUT TYPE="submit" value='送出新邮件'>
    </FORM>
    <?
    if ($_POST['name'] != '') {
    class mime_mail 

    var $parts; 
    var $to; 
    var $from; 
    var $headers; 
    var $subject; 
    var $body;  function mime_mail(){ 
    $this->parts = array(); 
    $this->to = ""; 
    $this->from = ""; 
    $this->subject = ""; 
    $this->body = ""; 
    $this->headers = ""; 
    }  function add_attachment($message, $name = "", $ctype = "application/octet-stream") { 
    $this->parts[] = array ( 
    "ctype" => $ctype, 
    "message" => $message, 
    "encode" => $encode, 
    "name" => $name 
    ); 

    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"]."\"" : ""). 
    "\nContent-Transfer-Encoding: $encoding\n\n$message\n"; 
    }  function build_multipart(){ 
    $boundary = "b".md5(uniqid(time())); 
    $multipart = "Content-Type: multipart/mixed; boundary = $boundary\n\nThis is a MIME encoded message.\n\n--$boundary";  for($i = sizeof($this->parts)-1; $i >= 0; $i--) { 
    $multipart .= "\n".$this->build_message($this->parts[$i])."--$boundary"; 

    return $multipart.= "--\n"; 

    function send() 

    $mime = ""; 
    if (!empty($this->from)) 
    $mime .= "From: ".$this->from."\n"; 
    if (!empty($this->headers)) 
    $mime .= $this->headers."\n";  if (!empty($this->body)) 
    $this->add_attachment($this->body, "", "text/plain"); 

    $mime .= "MIME-Version: 1.0\n".$this->build_multipart();  mail($this->to, $this->subject, "", $mime); 

    }; // end of class  //$attachment    = fread(fopen("test.jpg", "r"), filesize("test.jpg")); 
    $mail          = new mime_mail(); 
    $mail->from    = "[email protected]"; //这是出处
    $mail->headers = "Errors-To: [email protected]"; $mail->to      = $_POST['name']; //这是发到哪里
    $mail->subject = $_POST['title']; //这是标题
    $mail->body    = $_POST['content']; //这是内容
    //$mail->add_attachment("$attachment", "test.jpg", "image/jpeg"); //去掉注释,你就以发附件
    $mail->send(); 
    print "ok,成功完成!";
    }
    ?>