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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:59:01+00:00 2026-05-22T01:59:01+00:00

I have a Cakephp app that has users with ids and emails (emails might

  • 0

I have a Cakephp app that has users with ids and emails (emails might not be a valid address).

So I use pairmail and loop through the users table to send emails.

     foreach($users as $u)
     {
              if($this->sendMail($u['to'], $u['subject'], $u['text_message'], $u['html_message']))
                       //update database with sent email
     }

It works fine with 1 or 2 addresses, but it gets stuck when I run it through all the users. Is it because I have invalid addresses or my php script times out?

  • 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-22T01:59:01+00:00Added an answer on May 22, 2026 at 1:59 am
    • If you have a lot of mails to send write a script that is run in the background (called by cron or whatever); or else your request will time out.

    To cut down the delivery cruft you could:

    • Validate (with a regex) and sanitize (trim, etc.) email addresses before you try to send emails to them. People are stupid and put www. in their address or mistype them.
    • Catch delivery errors, see what happend (Why didn’t the mail server accept the email? Does the recipient exist?) and if the address is wrong mark and ignore it in future delivery runs.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple cakephp app with table articles that has a cat_id column
In my CakePHP 1.2.5 app, I have a Profile model that belongsTo a User
I have a CakePHP app that is being moved to Sql Server from MySql.
I have table 'pages' in my database. I have noticed that cakePHp has a
I have built a cakephp app that needs the user to login or register(for
I've got a model in CakePHP that doesn't have a table, called Upload. I've
Hey guys, I'm working on a cakephp app that manages a list of alpha
In one of my models, I have a LONGTEXT field that has a big
I am using the TCPDF app in CakePHP as a vendor. I have everything
I have a new web app that is packaged as a WAR as part

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.