php电子邮件表单帮助 - 如何提供帮助

how i can make a php email form , that can send 1 email to 20 emails or from where i can make this types of free email form php script.

To make an email form you will simply collect the data and process it. I will write a quick example below (this is not throttling enabled; google "e-mail throttling" for more information).

some_page.php

<form name="email-form" method="post" action="process_email.php">
<?php
for(int i=0;i<20;++i)
{
    print "Friend E-mail".$i."<br />".
    "<input type=\"text\" name=\"email[".$i."]\" /><br />";
}
?>
Message to send to users:
<textarea name="message" cols="20" rows="10">Type your message here...</textarea><br /><br />
<input type=\"submit\" value=\"Send e-mails\" /> <input type=\"reset\" value=\"Reset Form\" />
</form>

In the file above, you create a form with method="post" and action="LOCATION_OF_PROCESS_SCRIPT.php". This way it sends the form data collected to the script which should process the e-mail.

Now to process the form:

process_email.php

<?php
if($_POST['message'] == NULL)
{
    print "Please enter a message to send to your users.";
    exit;
}
foreach($_POST['email'] as $key => $val)
{
    if($val == NULL) continue; // Skip null e-mails
    mail($val,"Some subject",$_POST['message']);
}
?>

This is where all the information is processed. This simply sends out an e-mail with a static subject line to the e-mail specified with the message content specified in the form for the corresponding user.

Now, this is a very simple example but does everything you're asking for. You collect form data in array form, then you process your form arrays and send the messages accordingly. If you have further questions, feel free to ask. This list 20 e-mail forms, but skips blanks (in either e-mail or message). You can customize the form more, etc, but like I said: basic. Note that I did not debug this, but I'm pretty sure you shouldn't get any parsing errors.

Updated to send one email up to twenty users!

Good luck!
Dennis M.