Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9241697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:25:09+00:00 2026-06-18T08:25:09+00:00

I’m trying to create a very simple mailform. This is what I have so

  • 0

I’m trying to create a very simple mailform. This is what I have so far:

<html>
    <h2>Email Verzenden</h2>
        <script language = "Javascript">
        function explodeArray(emailID,delimiter) {
            tempArray=new Array(1);
            var Count=0;
            var tempString=new String(emailID);

            while (tempString.indexOf(delimiter)>0) {
                tempArray[Count]=tempString.substr(0,tempString.indexOf(delimiter));
                tempString=tempString.substr(tempString.indexOf(delimiter)+1,tempString.length-tempString.indexOf(delimiter)+1);
                Count=Count+1
                }

            tempArray[Count]=tempString.replace("\r","");
            return tempArray;
        } 

          function checkEmail(hallo) {
            if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(hallo)){
            return true;
            }
            return false;
          }
          function validate(){
            var emailID=document.form.email;
            var delimiter="\n";
            var emailArray=explodeArray(emailID.value,delimiter);
            var textID=document.form.text;
            var length = emailArray.length,
            element = null;
            for (var i = 0; i < length; i++) {
                emailVar = emailArray[i];

                if (emailVar==null){
                alert("Email-adres bestaat niet")
                emailID.focus()
                return false
                }               
                if (emailVar==""){
                alert("Email-adres veld is leeg")
                emailID.focus()
                return false
                }
                if (checkEmail(emailVar)==false){
                emailVar.value=""
                alert("Ongeldig E-mail adres");
                emailVar.focus()
                return false
                }
            }   
                if ((textID.value==null)||(textID.value==""))
                {
                alert("E-mail textveld is leeg")
                textID.focus()
                return false
                }
            return true
          }
        </script>
        <form name="form" method="post" onSubmit="return validate()">
        <pre>
            Vul hier de/het E-mail adres(sen) in
            <textarea name="email" rows="5" cols="50"></textarea><br>
            Typ hier de E-mail
            <textarea name="text" rows="5" cols="50"></textarea><br>
                        <input type="submit" name="Submit" value="Submit">
        </pre>
</form>
</html>

as you can see, there are 2 textareas. In the upper one, you’re supposed to put down email addresses underneath eachother, and in the bottom one you’re supposed to write the actual email. I already got my script to check if the email addresses are valid, and if the actual email actually has any input and whatnot, but I am clueless as to how to how implement any PHP code in order to actually send the e-mail to all the addresses filled in in the top textarea. Could anybody help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T08:25:10+00:00Added an answer on June 18, 2026 at 8:25 am
    <form method="post" action="yourscript.php" onsubmit="return validate()">
    your textareas here
    </form>
    

    make yourscript.php.

    <?
    if (!empty($_POST) && isset($_POST['email') && isset($_POST['text'])) {
     $emails = explode("\n", $_POST['email']);
    
     foreach($emails as $email) {
      if (filter_var($email, FILTER_VALIDATE_EMAIL)) { 
        mail($email, 'Subject', $_POST['text']);
      }
     }
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small JavaScript validation script that validates inputs based on Regex. I
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.