Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

186
Views
How do i send mails to multiple recipients

I am trying to simulate an email behavior using a database. These are the codes i used for sending mail to one recipient. How do i send it to multiple recipients.

    if($to=="" || $sub=="" || $msg=="")
    {
        $err= "<h3 style='color:red'>fill the related data first</h3>";
    }
    else
    {   
        $d=mysqli_query($con,"SELECT * FROM userinfo where email='$to'");
        $row=mysqli_num_rows($d);
        if($row==1)
        {
            mysqli_query($con,"INSERT INTO usermail values('','$to','$id','$sub','$msg','$file',sysdate())");

            $err= "<h3 style='color:blue'>Message sent...</h3>";
        }
        else
        {
            $sub=$sub."--"."msg failed";
            mysqli_query($con,"INSERT INTO usermail values('','$id','$id','$sub','$msg','$file',sysdate())");
            $err= "<h3 style='color:red'>Message failed because reciever not found...</h3>";
        }   
    }
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

If i got your problem:

Lets say $to="abc@x.com;zdf@x.com";

else
{ 
   $toStack = explode(';',$to);
   foreach($toStack as $to){
     $d=mysqli_query($con,"SELECT * FROM userinfo where email='$to'");
     /** and the rest of your code from the else block **/
   }
}

have a nice day..

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!