/var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/cakephp/src/Mailer/Transport
NameSizeModeActions
DebugTransport.php13780644editdlrm
MailTransport.php29990644editdlrm
SmtpTransport.php147860644editdlrm
Edit: /var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/cakephp/src/Mailer/Transport/MailTransport.php (2999B)
checkRecipient($message); // https://github.com/cakephp/cakephp/issues/2209 // https://bugs.php.net/bug.php?id=47983 $subject = str_replace("\r\n", '', $message->getSubject()); $to = $message->getHeaders(['to'])['To']; $to = str_replace("\r\n", '', $to); $eol = $this->getConfig('eol', PHP_EOL); $headers = $message->getHeadersString( [ 'from', 'sender', 'replyTo', 'readReceipt', 'returnPath', 'cc', 'bcc', ], $eol, function ($val) { return str_replace("\r\n", '', $val); } ); $message = $message->getBodyString($eol); $params = $this->getConfig('additionalParameters', ''); $this->_mail($to, $subject, $message, $headers, $params); $headers .= $eol . 'To: ' . $to; $headers .= $eol . 'Subject: ' . $subject; return ['headers' => $headers, 'message' => $message]; } /** * Wraps internal function mail() and throws exception instead of errors if anything goes wrong * * @param string $to email's recipient * @param string $subject email's subject * @param string $message email's body * @param string $headers email's custom headers * @param string $params additional params for sending email * @throws \Cake\Network\Exception\SocketException if mail could not be sent * @return void */ protected function _mail( string $to, string $subject, string $message, string $headers = '', string $params = '' ): void { // phpcs:disable if (!@mail($to, $subject, $message, $headers, $params)) { $error = error_get_last(); $msg = 'Could not send email: ' . ($error['message'] ?? 'unknown'); throw new Exception($msg); } // phpcs:enable } }