diff --git a/scripts/send_email.php b/scripts/send_email.php index 3a769813..f32ad622 100755 --- a/scripts/send_email.php +++ b/scripts/send_email.php @@ -34,7 +34,7 @@ function log_msg(string $msg): void echo '[' . date('Y-m-d H:i:s') . '] ' . $msg . PHP_EOL; } -function download_pdf(string $url): string|false +function download_pdf(string $url) { $ch = curl_init($url); curl_setopt_array($ch, [ @@ -59,7 +59,7 @@ function download_pdf(string $url): string|false return $data; } -function encrypt_pdf(string $input_path, string $password): string|false +function encrypt_pdf(string $input_path, string $password) { $output_path = $input_path . '_enc.pdf'; $cmd = sprintf( @@ -126,7 +126,7 @@ function send_email( string $subject, string $body_html, array $attachments = [] -): ?string { +) { $socket = @fsockopen('tcp://' . $smtp['server'], SMTP_PORT, $errno, $errstr, 30); if (!$socket) { return "Connection to {$smtp['server']}:" . SMTP_PORT . " failed: $errstr ($errno)";