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 957979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:47:31+00:00 2026-05-16T00:47:31+00:00

I am able to send email to one email id by defining the id

  • 0

I am able to send email to one email id by defining the id in the mailer, but i am not able to understand how to send to multiple recepients when an user types “mssage and email id’s” in a form. Ex – I am showing a form with two text areas – one for email id’s and one for custom message. So when they click send, i want to take the email id’s from that text area and send that message to those ids. I am yet to figure out how to comma/space seperate the emailds but will try it in google search.

thanks

  • 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-05-16T00:47:32+00:00Added an answer on May 16, 2026 at 12:47 am

    after doing some search, I came with this answer to send multiple address seperated by semicolon(for some reason my try with comma in this code failed, but i am fine with semicolon).

    If in case if anyone is looking for JS validation to check the id’s entered

    var emailRegex = /^(([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+([;.](([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+)*$/;
    

    As i collected the email id’s separated by semicolon, i had to replace ; with ,

    $emails_tosend = preg_replace('/;/', ',', $emailid);
    

    $email id – collected from the form

    so after doing the above replacement, i just use the normal “to” in the mailer to send to multiple recipients.

    $to = "$emails_tosend";
    mail ($to, $subject, $message, $headers);
    

    hope this helps and it’s clear. I can explain if anyone needs more clarification. thanks for all your help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When a button is clicked, the end user is able to send an email.
I'm writing a Nodejs app that needs to be able to send email. So
I need to be able to periodically send email alerts to subscribed users. PHP
I want to be able to send e-mail from my own domain (Domain.com) over
I'm building an application which will be able to send emails at any specific
I am able to send and receive message xmpp client and display them in
I need to be able to send the content type text/xml to Firefox and
I want to be able to send formatted text (i.e., text with format spans)
I'd like to be able to send a Ruby app to some colleagues without
What would be the easiest way to be able to send and receive raw

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.