如何使用多个表单操作?

时间:2014-10-17 07:45:12

标签: php jquery html css

我想向管理员发送2封邮件,向正常人发送一封邮件。因为我有两个PHP脚本。 但问题是我想一键发送邮件。 我可以使用两个表单操作,如sendmail.php和sendmail_client.php。 我该怎么做?

enter code here     <div class="clr"></div>
       <form action="sendmail.php" method="post" name="emailForm" id="emailForm">
    <input type="hidden" name="mode" value="send_eemail" />

            <div class="content_area">


                                <table class="form" width="100%" border="0" cellpadding="4" cellspacing="5">
                                    <tbody><tr><td colspan="2" class="error">* Required fields</td><div align="center" style="color:#FF0000; font-size:12px; font-weight:bold;" id="t"></div>
                                        <td class="error">&nbsp;</td></tr>
                                    <tr class="tr" style="padding:2px;">
                                        <td class="Career-body" style="width: 50%;">Name <span class="error">*</span></td>
                                        <td colspan="2">
                                        <input name="name" type="text" id="name" class="formText" size="40" required style="width: 267px"/></td>
                                    </tr>

                                                                                                            

</tbody></table> 

        </div></form>      

1 个答案:

答案 0 :(得分:0)

您可以附加多个电子邮件地址,如下所示:

$from = $_POST['email'];
$to = 'sampleemail@gmail.com';

$to .= "\n".$from;
$your_array = explode("\n", $to);
$imploded = implode(',', $your_array);
mail($imploded, $subject, $message, implode("\r\n", $headers));
相关问题