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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:40:22+00:00 2026-05-20T11:40:22+00:00

I am stuck heavily with this problem I got around 100 emails to send

  • 0

I am stuck heavily with this problem
I got around 100 emails to send mails to.
I want am trying to create one message and add all emails into the setTo method
I have tried all but nothing works, below is my last attempt.
$list comes from a query.

foreach($list as $item) {
    $name[] = $item->name; $email[] = "'".$item->email."'";
    $id = 0;
    $id = $id +1;
}
$message->setTo(array(implode(',',$email)));

Any ideas?

  • 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-20T11:40:23+00:00Added an answer on May 20, 2026 at 11:40 am

    Well, better answer can be provided if you show the structure of $list assuming the structure of $list is as you are using.

    foreach($list as $item)    {
    
         $persons[$item->email] = $item->name;
         $id = 0;
         $id = $id +1;
    
      }
      $message->setTo($persons);
    

    See here for info how to add recipients in setTo method

    http://swiftmailer.org/docs/recipients

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

Sidebar

Related Questions

im stuck with a problem im basically trying to create a function where I
Stuck with this issue for the past 2 days :-( Trying to create draggable
Im stuck with this little project in C# but basically my problem is this:
I'm a bit stuck on this. Basically I want to do something like the
Stuck trying to figure out the best algorithm here. I have this simple function
am stuck on trying to do this scenario which I didn't see much of,
Really stuck on trying to write code to unzip a file or directory on
I stuck with problem of mail application , i am developing a website for
Got stuck here: http://jsfiddle.net/UFkg8/ Right now the animation is top-down. What do I need
I stuck while trying to compile qpid c++ with boost 1_47_0 using Visual Studio

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.