Lisää mailbox-debug virheviestiin lähetyksen epäonnistuessa
Näyttää smtp_host, smtp_port, smtp_user, smtp_pass_len, imap_host, imap_user, imap_pass_len suoraan alertissa niin nähdään heti onko asetukset oikein. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
10
api.php
10
api.php
@@ -2330,7 +2330,15 @@ switch ($action) {
|
|||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
$smtpErr = $GLOBALS['smtp_last_error'] ?? '';
|
$smtpErr = $GLOBALS['smtp_last_error'] ?? '';
|
||||||
$detail = $smtpErr ? " ({$smtpErr})" : '';
|
$detail = $smtpErr ? " ({$smtpErr})" : '';
|
||||||
echo json_encode(['error' => "Sähköpostin lähetys epäonnistui{$detail}"]);
|
$mbDebug = $replyMailbox ? " [smtp_host=" . ($replyMailbox['smtp_host'] ?? 'EMPTY')
|
||||||
|
. " smtp_port=" . ($replyMailbox['smtp_port'] ?? '?')
|
||||||
|
. " smtp_user=" . ($replyMailbox['smtp_user'] ?? 'EMPTY')
|
||||||
|
. " smtp_pass_len=" . strlen($replyMailbox['smtp_password'] ?? '')
|
||||||
|
. " smtp_enc=" . ($replyMailbox['smtp_encryption'] ?? '?')
|
||||||
|
. " imap_host=" . ($replyMailbox['imap_host'] ?? '')
|
||||||
|
. " imap_user=" . ($replyMailbox['imap_user'] ?? '')
|
||||||
|
. " imap_pass_len=" . strlen($replyMailbox['imap_password'] ?? '') . "]" : ' [no mailbox]';
|
||||||
|
echo json_encode(['error' => "Sähköpostin lähetys epäonnistui{$detail}{$mbDebug}"]);
|
||||||
break 2;
|
break 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user