<?php
/* recipients */
$to  = "[email protected]" . ", " ; // note the comma
$to .= "[email protected]";/* subject */
$subject = "Birthday Reminders for August";/* message */
$message = '
<html>
<head>
<title>Birthday Reminders for August</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr>
  <th>Person</th><th>Day</th><th>Month</th><th>Year</th>
</tr>
<tr>
  <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
</tr>
<tr>
  <td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
</table>
</body>
</html>
';/* To send HTML mail, you can set the Content-type header. */
$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";/* additional headers */
$headers .= "To: Mary <[email protected]>, Kelly <[email protected]>\r\n";
$headers .= "From: Birthday Reminder <[email protected]>\r\n";
$headers .= "Cc: [email protected]\r\n";
$headers .= "Bcc: [email protected]\r\n";/* and now mail it */
mail($to, $subject, $message, $headers);
?>

解决方案 »

  1.   

    $to  = "[email protected]" . ", " ; // note the comma
    $to .= "[email protected]";这个是一个,在ASP里相当于to="aaaaaa"
    to=to&"bbbbb"你到一个支持发送邮件的服务器上试一下就OK了
      

  2.   

    $to的第二个前面的.就想当于asp,vb中 & 连接符号
    也类于其它语言中的+连接一样的。邮件发送的例子,我建议你多参考一下帮助,帮助里面有很多这种例子。
      

  3.   

    真晕了,因为开了个空间是PHP的,但我不想再研究PHP,我就用这一个程序就行,照着我给的那个ASP谁帮我编一下,我直接拷备就能用就可以。弄好了再多给200分!
      

  4.   

    要帮你写代码是不可能的,给你个例子自己改改吧
    $subject = "产品发布会在线报名";
    $body  = "";
    $body .= "公司名称:".$_POST["company"]."\r\n";
    $body .= "姓    名:".$_POST["name"]."\r\n";
    $body .= "职    务:".$_POST["postion"]."\r\n";
    $body .= "联系方式:".$_POST["connection"]."\r\n";

    $serverMail = "210.71.26.5";     //邮件服务器地址
    $mailTo = "[email protected]";        //发送目的地址
    $mailFrom = "[email protected]";     //发送源邮箱
    $serverPassword = "test";        //邮箱密码

    $jmail = new COM("JMAIL.Message"); //建立发送邮件的对象
    //$jMail->Encoding="base64";
    $jmail->ContentTransferEncoding="base64";
    $jmail->Charset = "GB2312"; //邮件的文字编码为国标<br>
    $jmail->ContentType="text/text"; //邮件的格式为HTML格式 
    $jmail->AddRecipient($mailTo); //邮件收件人的地址 
    $jmail->From = $mailFrom; //发件人的E-MAIL地址 
    $jmail->FromName=$_POST["name"];//发件人姓名
    $jmail->MailServerUserName = $mailFrom; //登录邮件服务器所需的用户名 
    $jmail->MailServerPassword = $serverPassword; //登录邮件服务器所需的密码 
    $jmail->Subject = $subject; //邮件的标题 
    $jmail->Body = $body; //邮件的内容 
    $jmail->Priority = 3; //邮件的紧急程序,1 为最快,5 为最慢, 3 为默认值 
    $jmail->Send($serverMail); //执行邮件发送(通过邮件服务器地址) 
    $jmail->Close(); //关闭对象 
    echo "<script>alert('您的信息已经发送,我们将尽快与您联系!');window.close();</script>";
      

  5.   

    楼上是jmail吧,其实livesylvia(问君何所之) 写得很清楚去。拿去就可以用了
      

  6.   

    最简单的就是 
    $headers  = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";mail("[email protected]","标题","内容", $headers);