提交表单的内容传到我的邮箱中,如何实现,是否用mail函数? <form action="mailto:URL" method=POST> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <form action="mailto:[email protected]" method=POST type=plain/mime>就可以了, 说错了以下<form action="mailto:[email protected]" method=POST enctype="text/plain"> 晕,这几天大家都在发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,成功完成!";}?> php form不能自动提交 哪位大侠知道PHP使用RS232串口通讯传送文件 高手帮忙解决!!!!!编码的问题 熟悉smarty缓存机制的朋友来看看 pHp include 和 request的问题!(include文件不执行,直接将php源码输出 用PHP连接Access出现的错误怎么解决??? 菜鸟问题,文件操作! 菜問題!!! 在include以及一些函数前面放@符号有什么用处。 语法问题? 为什么我在用ftp_connect()的时候,出现没有定意这个函数的错误? PHP安装要什么条件?
<form action="mailto:[email protected]" method=POST enctype="text/plain">
这是贴第三次了,附件没有做上,你自已改改吧,如果没有附件的话这样就可以用
<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,成功完成!";
}
?>