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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:05:30+00:00 2026-06-13T12:05:30+00:00

I am working on a mailing tool with Symfony 2.1 framework and SwiftMailer. This

  • 0

I am working on a mailing tool with Symfony 2.1 framework and SwiftMailer.

This tool needs to handle thousands of emails, but by groups of 500 because of a smtp server constraint (I can’t modify it). It needs to wait few minutes between each wave.

I totally don’t know how to do this.

The server running the app is on a Windows machine with Apache, and PHP 5.4. I could use a CRON task but I didn’t find anything about CRON and Symfony (I found that with Symfony 1.1, not really up to date).

  • 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-13T12:05:30+00:00Added an answer on June 13, 2026 at 12:05 pm

    I’d use Symfony’s built-in Command component here. You’re probably familiar with the normal Commands that come packaged with Symfony… Things like app/console generate:bundle, etc.

    You can use the ContainerAwareCommand class to write your own.

    Here are the steps you’ll need to take:

    • Keep a queue of emails that need to be sent (probably in a database table)
    • Create a class extending ContainerAwareCommand, and make the command name something like “email:send:partial”
      • This class should check for the existence of unsent emails from the database. If there is any, it should send up to 500 of them, and then either remove or update the records in the database to reflect the fact that they were sent.
      • By the way, ContainerAwareCommand is, of course, container-aware… Which means it has access to services like Monolog, Twig, and, most importantly here, Doctrine. So you’ll be able to retrieve unsent emails from the database table using $this->getContainer()->get("doctrine").
    • In cron, set up a regular job using the interval provided by your mail server (plus a minute or two to account for execution delays). The command for this will be /path/to/symfony/app/console email:send:partial

    That should get you there. Here are a few references for the ContainerAwareCommand class:

    http://symfony.com/doc/2.0/cookbook/console/console_command.html

    http://api.symfony.com/2.1/Symfony/Bundle/FrameworkBundle/Command/ContainerAwareCommand.html

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

Sidebar

Related Questions

I am using SwiftMailer to send emails from my application. All is working fine
Working with H2 I get this error when I try to write a row
Working on a project using Entity Framework (4.3.1.0). I'm trying to figure out how
I am working on a Mailing-List system combined with an online Forum. Mail Input
I'm working on a project to send alert notifications to a mailing list. I've
I am curious as to why this route is not working: routes.MapRoute(Tracking, {mailingId}/{subject}/{listItemId}/MailReport.{fileExtension}, new
I am working in a mailing application in C# and, basically, I need to
I am working on a signup for the mailing list and an trying to
I am working on a simple project involving Prospects and Offers . This project
I've been working on this for a long time, and I feel very worn

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.