copies() !== []) { $headers['Cc'] = implode(', ', $message->copies()); } if ($message->blindCopies() !== []) { $headers['Bcc'] = implode(', ', $message->blindCopies()); } $lines = []; foreach ($headers as $name => $value) { $lines[] = $name . ': ' . $value; } // Пятый аргумент задаёт обратный адрес конверта: без него письма уходят // от пользователя веб-сервера и часто попадают в спам $sent = @mail( implode(', ', $message->recipients()), Mime::encodeHeader($message->subjectLine()), $body['body'], implode("\r\n", $lines), '-f' . $message->senderEmail() ); if (!$sent) { throw new ProtonException('Функция mail() не приняла письмо. Проверьте sendmail_path в php.ini'); } } public function name(): string { return 'mail'; } }