How-To

Sendy campaign stuck on Preparing: cron and PHP 8.2 fixes

A Sendy campaign stuck on Preparing, Sending or Pending usually means the cron job that runs scheduled.php is not executing. Use full paths, run it every minute under the PHP version your Sendy release supports, and read the cron log. An "ambiguous redirect" error is a shell syntax problem in your cron line.

Sohail HussainSohail Hussain9 min read

Short answer

  • Sendy sends from a scheduled script, not from the web page. Run scheduled.php from cron every minute, with the full path to the PHP binary and to the script, and write the output to a log file.
  • If cron prints "ambiguous redirect", the redirect part of the line is broken, usually an unescaped percent sign or an empty variable. Use a plain one-line command instead of a wrapper script.
  • If the script runs clean and the campaign still sits in Preparing, check whether your Amazon SES account is still in the sandbox.

A campaign sits on Preparing, Sending or Pending. Stopping it shows "Sent 0 recipients". Or your own cron script prints this:

ambiguous redirect

The pattern comes from reports of Sendy 7.1.4 on Hostinger with PHP 8.2. Campaigns above roughly 100 recipients hung, the scheduler printed a PHP 8.2 deprecation, and a homemade cron script gave the error above. An older Stack Overflow question describes the same symptom: new campaigns stay Pending until the cron job is reset. Those reports describe symptoms and don't confirm a single root cause, so this guide sticks to checks you can run yourself.

Why a Sendy campaign gets stuck

Sendy does not send mail while you wait on the page. It queues the campaign, and a scheduled script picks the queue up. If that script never runs, or dies early, the status never moves. Three causes account for most cases, and they can stack:

  1. The cron job is missing, uses a wrong path, or fails silently.
  2. Cron runs a different PHP than your website does, with different extensions.
  3. The cron command is malformed, which is the ambiguous redirect case.

A fourth cause sits outside Sendy: Amazon SES refuses or throttles the mail, so the script runs but nothing leaves. I can't tell from outside which one is yours. The manual run in Fix 3 will.

What you seeLikely causeFix
Log file never created or stays emptyCron not running, or wrong pathFix 1
ambiguous redirectRedirect syntax: % or empty variableFix 4
PHP Fatal error or missing extension in the logCLI PHP differs from the website PHPFix 2
Deprecation lines only, then normal outputRelease written for an older PHP; a warning, not a stopFix 2
Script runs clean, campaign still PreparingSES sandbox, quota, region or credentialsFix 5
Fine for small sends, stalls above about 100 recipientsUnconfirmed; read the log during a large sendFix 3

Step-by-step fixes

Fix 1: run the scheduler by full path, every minute

Cron does not start in your Sendy folder, so relative paths and a bare php scheduled.php can do nothing without any message. Check Sendy's installation guide for the exact scripts and schedule your version expects; the usual setup for scheduled.php is every minute.

  1. In Hostinger's hPanel, open Cron Jobs (under the advanced tools).
  2. Set the schedule to every minute: * * * * *.
  3. Paste a command with absolute paths, then replace the user number, domain and folder with yours:
/usr/bin/php /home/u123456789/domains/example.com/public_html/sendy/scheduled.php >> /home/u123456789/sendy-cron.log 2>&1
  1. If you use autoresponders, add a separate line for autoresponders.php in the same folder.
  2. Delete duplicate or old cron lines for the same script.

Skip the second line to be safe

Stacking extra cron lines for the same script is a common reaction to a stuck campaign. It can make things worse, because two runs can touch the same queue at once.

Fix 2: make cron use the right PHP

Your site can run PHP 8.2 while the command line runs another version. Cron uses the CLI binary and its own php.ini, so mysqli, curl or mbstring can be missing there even when the website works.

  1. Connect over SSH and run:
which php
php -v
php -m | grep -i -E "mysqli|curl|mbstring"
  1. If the version is wrong, ask Hostinger support for the path to the binary of the PHP version you want. Put that full path in the cron line instead of /usr/bin/php.
  2. Check Sendy's requirements for your release. If PHP 8.2 is not listed, switch the site and the cron to the newest version it does list, then rerun.

A deprecation notice is a warning. PHP prints it and carries on, so it rarely explains a stuck campaign by itself. It does suggest the release was written for an older PHP. If a real fatal error follows the deprecation lines in the log, that error is your cause.

Fix 3: run it by hand and read the log

  1. In SSH, run the exact command from your cron line without the redirect:
/usr/bin/php /home/u123456789/domains/example.com/public_html/sendy/scheduled.php
  1. Watch the output for PHP Fatal error, Parse error, a database connection failure or a missing class. Any of those means the script dies before sending.
  2. Wait for cron to fire a few times, then open sendy-cron.log. An empty or missing file means cron never ran; recheck the schedule and the path.
  3. For the "above 100 recipients" pattern, keep the log open during a large send and look for timeouts or memory errors.

Fix 4: repair the "ambiguous redirect" error

ambiguous redirect is a bash error. The target after > or >> expanded to nothing, or to more than one word. It is not a Sendy error. In cron lines there are two usual culprits.

An unescaped percent sign. In a crontab, an unescaped % is treated as a newline, so a dated log name breaks the command:

# breaks
* * * * * /usr/bin/php /path/to/scheduled.php >> /home/u123456789/sendy-$(date +%F).log 2>&1

# works
* * * * * /usr/bin/php /path/to/scheduled.php >> /home/u123456789/sendy-$(date +\%F).log 2>&1

An empty or spaced variable. >> $LOGFILE fails when LOGFILE is not set in cron's environment or contains a space. Cron does not load your shell profile. Set the variable inside the script or write the literal path, and quote any path with spaces.

The simplest fix is to drop the wrapper script and use the one-line command from Fix 1.

Fix 5: rule out Amazon SES

If the script runs clean and the campaign still sits in Preparing, look at SES. In the sandbox you can only send to verified addresses and domains (or the mailbox simulator), at most 200 messages per 24-hour period and 1 message per second. A real list stalls against that.

  • Region. Sandbox status is unique to each AWS Region, so confirm the region saved in Sendy is the one where you got production access.
  • Credentials and quota. Check that the access keys saved in Sendy are current and that you have not hit the daily quota.
  • Status check. The SES API reports sandbox state: if ProductionAccessEnabled is false, the account is in the sandbox.

To leave the sandbox, open the SES console, choose Account dashboard, then in the sandbox warning box choose View Get set up page followed by Request production access. AWS Support gives an initial response within 96 hours, so request it well before a big send. The steps are in AWS's guide to moving out of the SES sandbox.

Test with a tiny list first

After any change, send to a list of three or four addresses. If that moves from Preparing to Sent within a few minutes, the scheduler works, and any remaining stall comes from volume or SES limits.

Checklist before you try again

  • One cron line per script, every minute, with absolute paths.
  • The PHP binary in the cron line matches a version your Sendy release supports.
  • A log file is written, and you have read it after a manual run.
  • No unescaped % and no unset variables after >>.
  • SES is out of the sandbox in the same region Sendy uses.
  • Access keys in Sendy are current.

If nothing works

Contact your host first, then AWS for SES questions, then Sendy's own support channel for a script problem that survives all of the above. Hostinger support can confirm the CLI PHP path and whether cron is limited on your plan. Send them the exact cron command, the output of php -v, and a timestamped log excerpt. Here is a message you can copy:

Hello, I run a PHP script by cron on my hosting plan (domain: example.com).
Cron line: /usr/bin/php /home/u123456789/domains/example.com/public_html/sendy/scheduled.php
Schedule: every minute. Problem: the script does not complete; the application stays on "Preparing".
php -v over SSH returns: {paste output}
Log excerpt with timestamps: {paste lines}
Please confirm (1) the correct CLI path for PHP 8.2, (2) that mysqli, curl and mbstring
are enabled for the CLI, and (3) whether my plan limits cron frequency or run time.

If you would rather not maintain cron

Self-hosted Sendy means you own the server, the PHP version and the scheduler. We make Mailneo, so weigh this accordingly. It is a hosted web app, so there is no server or cron job for you to maintain, and it sends through mailboxes and providers you connect, including Amazon SES. See how email accounts connect. SES sandbox and quota limits stay with AWS either way.

If Sendy has worked for you and only the cron broke, fix the cron first. The steps above cover most stuck-campaign cases.

Common questions

Why does the campaign stay Pending until I reset the cron job?

The older Stack Overflow report describes exactly that. The likely reading is that the cron process is stuck or not firing, so recreating it restarts it. The thread doesn't confirm the cause; the manual run and the log in Fix 3 will show whether the script exits early.

Is the PHP 8.2 deprecation message the cause?

Usually not on its own. A deprecation is a warning and PHP keeps running. Treat it as a sign that your Sendy release may not support 8.2, and look for a fatal error after it.

How often should the Sendy cron run?

Every minute for scheduled.php is the usual setup, so a slower interval delays campaigns. Confirm against the installation guide for your Sendy version.

Can I fix this without SSH?

Partly. You can edit the cron line in hPanel, but without SSH you can't run php -v or the manual test. Ask your host to run them or to confirm the CLI PHP path.

strategysendyhostingeramazon-seserror-codes
Share this article
Sohail Hussain

Sohail Hussain

Founder & CEO at Mailneo

Building Mailneo — AI-powered email marketing for growing businesses.

Ready to supercharge your email marketing?

Start sending smarter emails with AI-powered campaigns. No credit card required.

Get Started Free