{"record":{"id":"7d1e8cd7674100db","repo":"ellite/Wallos","slug":"stop-critical","errorCode":"STOP_CRITICAL","errorMessage":"You must provide at least one recipient email address.","messagePattern":"You must provide at least one recipient email address\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"libs/PHPMailer/PHPMailer.php","lineNumber":1569,"sourceCode":"            && ((\\PHP_VERSION_ID >= 70000 && \\PHP_VERSION_ID < 70017)\n                || (\\PHP_VERSION_ID >= 70100 && \\PHP_VERSION_ID < 70103))\n            && ini_get('mail.add_x_header') === '1'\n            && stripos(PHP_OS, 'WIN') === 0\n        ) {\n            trigger_error($this->lang('buggy_php'), E_USER_WARNING);\n        }\n\n        try {\n            $this->error_count = 0; //Reset errors\n            $this->mailHeader = '';\n\n            //Dequeue recipient and Reply-To addresses with IDN\n            foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) {\n                $params[1] = $this->punyencodeAddress($params[1]);\n                call_user_func_array([$this, 'addAnAddress'], $params);\n            }\n            if (count($this->to) + count($this->cc) + count($this->bcc) < 1) {\n                throw new Exception($this->lang('provide_address'), self::STOP_CRITICAL);\n            }\n\n            //Validate From, Sender, and ConfirmReadingTo addresses\n            foreach (['From', 'Sender', 'ConfirmReadingTo'] as $address_kind) {\n                if ($this->{$address_kind} === null) {\n                    $this->{$address_kind} = '';\n                    continue;\n                }\n                $this->{$address_kind} = trim($this->{$address_kind});\n                if (empty($this->{$address_kind})) {\n                    continue;\n                }\n                $this->{$address_kind} = $this->punyencodeAddress($this->{$address_kind});\n                if (!static::validateAddress($this->{$address_kind})) {\n                    $error_message = sprintf(\n                        '%s (%s): %s',\n                        $this->lang('invalid_address'),\n                        $address_kind,","sourceCodeStart":1551,"sourceCodeEnd":1587,"githubUrl":"https://github.com/ellite/Wallos/blob/52820e87ca5a6e105fdbb7f1c0c681bc0cfee2fd/libs/PHPMailer/PHPMailer.php#L1551-L1587","documentation":"preSend() throws 'You must provide at least one recipient email address.' with severity STOP_CRITICAL when, after all recipient queues are replayed, count($to)+count($cc)+count($bcc) is zero. send() calls preSend(), so the whole send aborts. The localized text comes from $this->lang('provide_address').","triggerScenarios":"Calling $mail->send() with no addAddress/addCC/addBCC (and no RecipientsQueue entries); addAddress calls that silently failed (returned false without exceptions enabled) also lead here because the recipient count stays zero.","commonSituations":"Building mail dynamically where recipient list ends up empty (filtered array), addAddress failing earlier due to invalid addresses while exceptions were disabled so errors were swallowed, refactored code that moved recipient setup behind a condition that no longer runs.","solutions":["Call addAddress() (or addCC/addBCC) at least once before send()","Check the return value / exceptions of every addAddress() so failed additions are not silently ignored","Guard before sending: if (!$mail->getToAddresses() && !$mail->getCcAddresses() && !$mail->getBccAddresses()) skip or report","When sending conditionally, ensure the recipient list is populated from a validated data source"],"exampleFix":"// before\n$mail->send(); // throws if no recipients\n// after\nif (empty($mail->getToAddresses()) && empty($mail->getCcAddresses()) && empty($mail->getBccAddresses())) {\n    throw new RuntimeException('No recipients to send to');\n}\n$mail->send();","handlingStrategy":"try-catch","validationCode":"if (count($mail->getToAddresses()) + count($mail->getCcAddresses()) + count($mail->getBccAddresses()) === 0) { throw new LogicException('No recipients set'); }","typeGuard":null,"tryCatchPattern":"try { $mail->send(); } catch (PHPMailer\\PHPMailer\\Exception $e) { if ($e->getCode() === PHPMailer::STOP_CRITICAL && str_contains($e->getMessage(), 'recipient')) { /* recipient list empty */ } throw $e; }","preventionTips":["Assert recipients exist before send() in a small wrapper around PHPMailer","Check addAddress() return values; a false return means the recipient was not added","Avoid filtering recipient arrays to empty without a guard","Centralize mail-sending in one service so recipient setup can be enforced"],"tags":["php","phpmailer","email","missing-recipient"],"backgroundTag":"missing-required-argument","analyzedSha":"52820e87ca5a6e105fdbb7f1c0c681bc0cfee2fd","analyzedAt":"2026-09-13T14:09:30.873Z","contentChangedAt":"2026-09-13T14:09:30.873Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}