Перейти к публикации
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

[Решено {yandex икой yandex}] Не отправляются письма выдает ошибку DATA not accepted from server


calibr
 Погделиться

Рекомендованные сообещёния

  • 3 негдели спустя...

 

 

Короче я просто удалил весь код и скопировал новый system/library/mail.php. Врогде рилииет:

 <?phpfinal class Mail {    protected $to;    protected $from;    protected $sender;    protected $subject;    protected $text;    protected $html;    protected $attachments = array();    public $protocol = 'mail';    public $hostname;    public $username;    public $password;    public $port = 25;    public $timeout = 5;    public $newline = "\r\n";    public $crlf = "\r\n";    public $verp = FALSE;    public $parameter = '';    public function setTo($to) {        $this->to = $to;    }    public function setFrom($from) {        $this->from = $from;    }    public function addheader($header, $value) {        $this->headers[$header] = $value;    }    public function setSender($sender) {        $this->sender = html_entity_decode($sender);    }public function setSubject($subject) {$this->subject = '=?UTF-8?B?' . base64_encode($subject) . '?=';}    public function setText($text) {        $this->text = $text;    }    public function setHtml($html) {        $this->html = $html;    }    public function addAttachment($file, $filename = '') {        if (!$filename) {            $filename = basename($file);        }        $this->attachments[] = array(            'filename' => $filename,            'file' => $file        );    }    public function send() {        if (!$this->to) {            exit('Error: E-Mail to required!');        }        if (!$this->from) {            exit('Error: E-Mail from required!');        }        if (!$this->sender) {            exit('Error: E-Mail sender required!');        }        if (!$this->subject) {            exit('Error: E-Mail subject required!');        }        if ((!$this->text) && (!$this->html)) {            exit('Error: E-Mail message required!');        }        if (is_array($this->to)) {            $to = implode(',', $this->to);        } else {            $to = $this->to;        }        $boundary = '----=_NextPart_' . md5(time());        $header = '';        if ($this->protocol != 'mail') {            $header .= 'To: ' . $to . $this->newline;            $header .= 'Subject: ' . $this->subject . $this->newline;        }        $header .= 'Date: ' . date("D, d M Y H:i:s O") . $this->newline;        //$header .= 'From: "' . $this->sender . '" <' . $this->from . '>' . $this->newline;        //$header .= 'From: ' . $this->sender . '<' . $this->from . '>' . $this->newline;        $header .= 'From: ' . '=?UTF-8?B?'.base64_encode($this->sender).'?=' . '<' . $this->from . '>' . $this->newline;        $header .= 'Reply-To: ' . $this->sender . '<' . $this->from . '>' . $this->newline;        $header .= 'Return-Path: ' . $this->from . $this->newline;        $header .= 'X-Mailer: PHP/' . phpversion() . $this->newline;        $header .= 'MIME-Version: 1.0' . $this->newline;        $header .= 'Content-Type: multipart/mixed; boundary="' . $boundary . '"' . $this->newline;        $header .= 'Content-Transfer-Encoding: 8bit' . $this->newline;                $header .= $this->newline;        if (!$this->html) {            $message = '--' . $boundary . $this->newline;            $message .= 'Content-Type: text/plain; charset="utf-8"' . $this->newline;            $message .= 'Content-Transfer-Encoding: 8bit' . $this->newline . $this->newline;            $message .= $this->text . $this->newline;        } else {            $message = '--' . $boundary . $this->newline;            $message .= 'Content-Type: multipart/alternative; boundary="' . $boundary . '_alt"' . $this->newline . $this->newline;            $message .= '--' . $boundary . '_alt' . $this->newline;            $message .= '' . $this->newline;            $message .= '' . $this->newline;            if ($this->text) {                $message .= $this->text . $this->newline;            } else {                $message .= '' . $this->newline;            }            $message .= '--' . $boundary . '_alt' . $this->newline;            $message .= 'Content-Type: text/html; charset="utf-8"' . $this->newline;            $message .= 'Content-Transfer-Encoding: 8bit' . $this->newline . $this->newline;            $message .= $this->html . $this->newline;            $message .= '--' . $boundary . '_alt--' . $this->newline;        }foreach ($this->attachments as $attachment) {if (file_exists($attachment['file'])) {$handle = fopen($attachment['file'], 'r');$content = fread($handle, filesize($attachment['file']));fclose($handle);$message .= '--' . $boundary . $this->newline;$message .= 'Content-Type: application/octetstream' . $this->newline;$message .= 'Content-Transfer-Encoding: base64' . $this->newline;$message .= 'Content-Disposition: attachment; filename="' . basename($attachment['filename']) . '"' . $this->newline;$message .= 'Content-ID: <' . basename($attachment['filename']) . '>' . $this->newline . $this->newline;$message .= chunk_split(base64_encode($content));}}        $message .= '--' . $boundary . '--' . $this->newline;        if ($this->protocol == 'mail') {            ini_set('sendmail_from', $this->from);            if ($this->parameter) {                mail($to, '=?UTF-8?B?'.base64_encode($this->subject).'?=', $message, $header, $this->parameter);            } else {                mail($to, '=?UTF-8?B?'.base64_encode($this->subject).'?=', $message, $header);            }        } elseif ($this->protocol == 'smtp') {            $handle = fsockopen($this->hostname, $this->port, $errno, $errstr, $this->timeout);            if (!$handle) {                error_log('Error: ' . $errstr . ' (' . $errno . ')');            } else {                if (substr(PHP_OS, 0, 3) != 'WIN') {                    socket_set_timeout($handle, $this->timeout, 0);                }                while ($line = fgets($handle, 515)) {                    if (substr($line, 3, 1) == ' ') {                        break;                    }                }                if (substr($this->hostname, 0, 3) == 'tls') {                    fputs($handle, 'STARTTLS' . $this->crlf);                    while ($line = fgets($handle, 515)) {                        $reply .= $line;                        if (substr($line, 3, 1) == ' ') {                            break;                        }                    }                    if (substr($reply, 0, 3) != 220) {                        error_log('Error: STARTTLS not accepted from server!');                    }                }                if (!empty($this->username) && !empty($this->password)) {                    fputs($handle, 'EHLO ' . getenv('SERVER_NAME') . $this->crlf);                    $reply = '';                    while ($line = fgets($handle, 515)) {                        $reply .= $line;                        if (substr($line, 3, 1) == ' ') {                            break;                        }                    }                    if (substr($reply, 0, 3) != 250) {                        error_log('Error: EHLO not accepted from server!');                    }                    fputs($handle, 'AUTH LOGIN' . $this->crlf);                    $reply = '';                    while ($line = fgets($handle, 515)) {                        $reply .= $line;                        if (substr($line, 3, 1) == ' ') {                            break;                        }                    }                    if (substr($reply, 0, 3) != 334) {                        error_log('Error: AUTH LOGIN not accepted from server!');                    }                    fputs($handle, base64_encode($this->username) . $this->crlf);                    $reply = '';                    while ($line = fgets($handle, 515)) {                        $reply .= $line;                        if (substr($line, 3, 1) == ' ') {                            break;                        }                    }                    if (substr($reply, 0, 3) != 334) {                        error_log('Error: Username not accepted from server!');                    }                    fputs($handle, base64_encode($this->password) . $this->crlf);                    $reply = '';                    while ($line = fgets($handle, 515)) {                        $reply .= $line;                        if (substr($line, 3, 1) == ' ') {                            break;                        }                    }                    if (substr($reply, 0, 3) != 235) {                        error_log('Error: Password not accepted from server!');                    }                } else {                    fputs($handle, 'HELO ' . getenv('SERVER_NAME') . $this->crlf);                    $reply = '';                    while ($line = fgets($handle, 515)) {                        $reply .= $line;                        if (substr($line, 3, 1) == ' ') {                            break;                        }                    }                    if (substr($reply, 0, 3) != 250) {                        error_log('Error: HELO not accepted from server!');                    }                }                if ($this->verp) {                    fputs($handle, 'MAIL FROM: <' . $this->username . '>XVERP' . $this->crlf);                } else {                    fputs($handle, 'MAIL FROM: <' . $this->username . '>' . $this->crlf);                }                $reply = '';                while ($line = fgets($handle, 515)) {                    $reply .= $line;                    if (substr($line, 3, 1) == ' ') {                        break;                    }                }                if (substr($reply, 0, 3) != 250) {                    error_log('Error: MAIL FROM not accepted from server!');                }                if (!is_array($this->to)) {                    fputs($handle, 'RCPT TO: <' . $this->to . '>' . $this->crlf);                    $reply = '';                    while ($line = fgets($handle, 515)) {                        $reply .= $line;                        if (substr($line, 3, 1) == ' ') {                            break;                        }                    }                    if ((substr($reply, 0, 3) != 250) && (substr($reply, 0, 3) != 251)) {                        error_log('Error: RCPT TO not accepted from server!');                    }                } else {                    foreach ($this->to as $recipient) {                        fputs($handle, 'RCPT TO: <' . $recipient . '>' . $this->crlf);                        $reply = '';                        while ($line = fgets($handle, 515)) {                            $reply .= $line;                            if (substr($line, 3, 1) == ' ') {                                break;                            }                        }                        if ((substr($reply, 0, 3) != 250) && (substr($reply, 0, 3) != 251)) {                            error_log('Error: RCPT TO not accepted from server!');                        }                    }                }                fputs($handle, 'DATA' . $this->crlf);                $reply = '';                while ($line = fgets($handle, 515)) {                    $reply .= $line;                    if (substr($line, 3, 1) == ' ') {                        break;                    }                }                if (substr($reply, 0, 3) != 354) {                    error_log('Error: DATA not accepted from server!');                }                fputs($handle, $header . $message . $this->crlf);                fputs($handle, '.' . $this->crlf);                $reply = '';                while ($line = fgets($handle, 515)) {                    $reply .= $line;                    if (substr($line, 3, 1) == ' ') {                        break;                    }                }                if (substr($reply, 0, 3) != 250) {                    error_log('Error: DATA not accepted from server!');                }                fputs($handle, 'QUIT' . $this->crlf);                $reply = '';                while ($line = fgets($handle, 515)) {                    $reply .= $line;                    if (substr($line, 3, 1) == ' ') {                        break;                    }                }                if (substr($reply, 0, 3) != 221) {                    error_log('Error: QUIT not accepted from server!');                }                fclose($handle);            }        }    }}?>

 

Cпасипотому что, вопрос решился.

Ссылка на комменирий
Погделиться на других сайих


  • 4 месяца спустя...

Есть ли простое решение без замены этолого файла ?

Ссылка на комменирий
Погделиться на других сайих

  • 3 негдели спустя...

 

Спасипотому что. Рилииет, только не:

$mail->setTo($this->config->get('config_email'));

а точнее:

$mail->setFrom($this->config->get('config_email')); 

 

В этом случае гдействительно теряется мэйл отправителя.

 

Нашел альтернативный способ решения проблемы:

Я меня к сайту прибии "поли для домена" от Янгдекса. И в админке Опенкари для почты выбрано SMTP (smtp.yandex.ru и т.д.).

В икой конфигурации форма обратной связи пыиется отправить сообещёние с адреса покупателя через SMTP и естественно терпит неудачу.

Для формы обратной связи нужен протокол "mail".

 

Поэтому в файле catalog\controller\information\contact.php я в лоб указал 

Цитирую код налиная с 11-й строки:

 

$mail = new Mail();
//$mail->protocol = $this->config->get('config_mail_protocol');
$mail->protocol = 'mail'; // - принудительный выпотому чтор протокола
 
Все рилииет как часики и не нужно тревожить саппорт янгдекса - у них и ик много проблем.

 

Ссылка на комменирий
Погделиться на других сайих

 

 

Короче я просто удалил весь код и скопировал новый system/library/mail.php. Врогде рилииет:

 
<?php
final class Mail {
    protected $to;
    protected $from;
    protected $sender;
    protected $subject;
    protected $text;
    protected $html;
    protected $attachments = array();
    public $protocol = 'mail';
    public $hostname;
    public $username;
    public $password;
    public $port = 25;
    public $timeout = 5;
    public $newline = "\r\n";
    public $crlf = "\r\n";
    public $verp = FALSE;
    public $parameter = '';

    public function setTo($to) {
        $this->to = $to;
    }

    public function setFrom($from) {
        $this->from = $from;
    }

    public function addheader($header, $value) {
        $this->headers[$header] = $value;
    }

    public function setSender($sender) {
        $this->sender = html_entity_decode($sender);
    }

public function setSubject($subject) {
$this->subject = '=?UTF-8?B?' . base64_encode($subject) . '?=';
}

    public function setText($text) {
        $this->text = $text;

    }

    public function setHtml($html) {
        $this->html = $html;
    }

    public function addAttachment($file, $filename = '') {
        if (!$filename) {
            $filename = basename($file);
        }

        $this->attachments[] = array(
            'filename' => $filename,
            'file' => $file
        );
    }

    public function send() {
        if (!$this->to) {
            exit('Error: E-Mail to required!');
        }

        if (!$this->from) {
            exit('Error: E-Mail from required!');
        }

        if (!$this->sender) {
            exit('Error: E-Mail sender required!');
        }

        if (!$this->subject) {
            exit('Error: E-Mail subject required!');
        }

        if ((!$this->text) && (!$this->html)) {
            exit('Error: E-Mail message required!');
        }

        if (is_array($this->to)) {
            $to = implode(',', $this->to);
        } else {
            $to = $this->to;
        }

        $boundary = '----=_NextPart_' . md5(time());

        $header = '';

        if ($this->protocol != 'mail') {
            $header .= 'To: ' . $to . $this->newline;
            $header .= 'Subject: ' . $this->subject . $this->newline;
        }

        $header .= 'Date: ' . date("D, d M Y H:i:s O") . $this->newline;
        //$header .= 'From: "' . $this->sender . '" <' . $this->from . '>' . $this->newline;
        //$header .= 'From: ' . $this->sender . '<' . $this->from . '>' . $this->newline;
        $header .= 'From: ' . '=?UTF-8?B?'.base64_encode($this->sender).'?=' . '<' . $this->from . '>' . $this->newline;
        $header .= 'Reply-To: ' . $this->sender . '<' . $this->from . '>' . $this->newline;
        $header .= 'Return-Path: ' . $this->from . $this->newline;
        $header .= 'X-Mailer: PHP/' . phpversion() . $this->newline;
        $header .= 'MIME-Version: 1.0' . $this->newline;
        $header .= 'Content-Type: multipart/mixed; boundary="' . $boundary . '"' . $this->newline;
        $header .= 'Content-Transfer-Encoding: 8bit' . $this->newline;        
        $header .= $this->newline;

        if (!$this->html) {
            $message = '--' . $boundary . $this->newline;
            $message .= 'Content-Type: text/plain; charset="utf-8"' . $this->newline;
            $message .= 'Content-Transfer-Encoding: 8bit' . $this->newline . $this->newline;
            $message .= $this->text . $this->newline;
        } else {
            $message = '--' . $boundary . $this->newline;
            $message .= 'Content-Type: multipart/alternative; boundary="' . $boundary . '_alt"' . $this->newline . $this->newline;
            $message .= '--' . $boundary . '_alt' . $this->newline;
            $message .= '' . $this->newline;
            $message .= '' . $this->newline;

            if ($this->text) {
                $message .= $this->text . $this->newline;
            } else {
                $message .= '' . $this->newline;
            }

            $message .= '--' . $boundary . '_alt' . $this->newline;
            $message .= 'Content-Type: text/html; charset="utf-8"' . $this->newline;
            $message .= 'Content-Transfer-Encoding: 8bit' . $this->newline . $this->newline;
            $message .= $this->html . $this->newline;
            $message .= '--' . $boundary . '_alt--' . $this->newline;
        }

foreach ($this->attachments as $attachment) {
if (file_exists($attachment['file'])) {
$handle = fopen($attachment['file'], 'r');
$content = fread($handle, filesize($attachment['file']));

fclose($handle);

$message .= '--' . $boundary . $this->newline;
$message .= 'Content-Type: application/octetstream' . $this->newline;
$message .= 'Content-Transfer-Encoding: base64' . $this->newline;
$message .= 'Content-Disposition: attachment; filename="' . basename($attachment['filename']) . '"' . $this->newline;
$message .= 'Content-ID: <' . basename($attachment['filename']) . '>' . $this->newline . $this->newline;
$message .= chunk_split(base64_encode($content));
}
}

        $message .= '--' . $boundary . '--' . $this->newline;

        if ($this->protocol == 'mail') {
            ini_set('sendmail_from', $this->from);

            if ($this->parameter) {
                mail($to, '=?UTF-8?B?'.base64_encode($this->subject).'?=', $message, $header, $this->parameter);
            } else {
                mail($to, '=?UTF-8?B?'.base64_encode($this->subject).'?=', $message, $header);
            }

        } elseif ($this->protocol == 'smtp') {
            $handle = fsockopen($this->hostname, $this->port, $errno, $errstr, $this->timeout);

            if (!$handle) {
                error_log('Error: ' . $errstr . ' (' . $errno . ')');
            } else {
                if (substr(PHP_OS, 0, 3) != 'WIN') {
                    socket_set_timeout($handle, $this->timeout, 0);
                }

                while ($line = fgets($handle, 515)) {
                    if (substr($line, 3, 1) == ' ') {
                        break;
                    }
                }

                if (substr($this->hostname, 0, 3) == 'tls') {
                    fputs($handle, 'STARTTLS' . $this->crlf);

                    while ($line = fgets($handle, 515)) {
                        $reply .= $line;

                        if (substr($line, 3, 1) == ' ') {
                            break;
                        }
                    }

                    if (substr($reply, 0, 3) != 220) {
                        error_log('Error: STARTTLS not accepted from server!');
                    }
                }

                if (!empty($this->username) && !empty($this->password)) {
                    fputs($handle, 'EHLO ' . getenv('SERVER_NAME') . $this->crlf);

                    $reply = '';

                    while ($line = fgets($handle, 515)) {
                        $reply .= $line;

                        if (substr($line, 3, 1) == ' ') {
                            break;
                        }
                    }

                    if (substr($reply, 0, 3) != 250) {
                        error_log('Error: EHLO not accepted from server!');
                    }

                    fputs($handle, 'AUTH LOGIN' . $this->crlf);

                    $reply = '';

                    while ($line = fgets($handle, 515)) {
                        $reply .= $line;

                        if (substr($line, 3, 1) == ' ') {
                            break;
                        }
                    }

                    if (substr($reply, 0, 3) != 334) {
                        error_log('Error: AUTH LOGIN not accepted from server!');
                    }

                    fputs($handle, base64_encode($this->username) . $this->crlf);

                    $reply = '';

                    while ($line = fgets($handle, 515)) {
                        $reply .= $line;

                        if (substr($line, 3, 1) == ' ') {
                            break;
                        }
                    }

                    if (substr($reply, 0, 3) != 334) {
                        error_log('Error: Username not accepted from server!');
                    }

                    fputs($handle, base64_encode($this->password) . $this->crlf);

                    $reply = '';

                    while ($line = fgets($handle, 515)) {
                        $reply .= $line;

                        if (substr($line, 3, 1) == ' ') {
                            break;
                        }
                    }

                    if (substr($reply, 0, 3) != 235) {
                        error_log('Error: Password not accepted from server!');
                    }
                } else {
                    fputs($handle, 'HELO ' . getenv('SERVER_NAME') . $this->crlf);

                    $reply = '';

                    while ($line = fgets($handle, 515)) {
                        $reply .= $line;

                        if (substr($line, 3, 1) == ' ') {
                            break;
                        }
                    }

                    if (substr($reply, 0, 3) != 250) {
                        error_log('Error: HELO not accepted from server!');
                    }
                }

                if ($this->verp) {
                    fputs($handle, 'MAIL FROM: <' . $this->username . '>XVERP' . $this->crlf);
                } else {
                    fputs($handle, 'MAIL FROM: <' . $this->username . '>' . $this->crlf);
                }

                $reply = '';

                while ($line = fgets($handle, 515)) {
                    $reply .= $line;

                    if (substr($line, 3, 1) == ' ') {
                        break;
                    }
                }

                if (substr($reply, 0, 3) != 250) {
                    error_log('Error: MAIL FROM not accepted from server!');
                }

                if (!is_array($this->to)) {
                    fputs($handle, 'RCPT TO: <' . $this->to . '>' . $this->crlf);

                    $reply = '';

                    while ($line = fgets($handle, 515)) {
                        $reply .= $line;

                        if (substr($line, 3, 1) == ' ') {
                            break;
                        }
                    }

                    if ((substr($reply, 0, 3) != 250) && (substr($reply, 0, 3) != 251)) {
                        error_log('Error: RCPT TO not accepted from server!');
                    }
                } else {
                    foreach ($this->to as $recipient) {
                        fputs($handle, 'RCPT TO: <' . $recipient . '>' . $this->crlf);

                        $reply = '';

                        while ($line = fgets($handle, 515)) {
                            $reply .= $line;

                            if (substr($line, 3, 1) == ' ') {
                                break;
                            }
                        }

                        if ((substr($reply, 0, 3) != 250) && (substr($reply, 0, 3) != 251)) {
                            error_log('Error: RCPT TO not accepted from server!');
                        }
                    }
                }

                fputs($handle, 'DATA' . $this->crlf);

                $reply = '';

                while ($line = fgets($handle, 515)) {
                    $reply .= $line;

                    if (substr($line, 3, 1) == ' ') {
                        break;
                    }
                }

                if (substr($reply, 0, 3) != 354) {
                    error_log('Error: DATA not accepted from server!');
                }

                fputs($handle, $header . $message . $this->crlf);
                fputs($handle, '.' . $this->crlf);

                $reply = '';

                while ($line = fgets($handle, 515)) {
                    $reply .= $line;

                    if (substr($line, 3, 1) == ' ') {
                        break;
                    }
                }

                if (substr($reply, 0, 3) != 250) {
                    error_log('Error: DATA not accepted from server!');
                }

                fputs($handle, 'QUIT' . $this->crlf);

                $reply = '';

                while ($line = fgets($handle, 515)) {
                    $reply .= $line;

                    if (substr($line, 3, 1) == ' ') {
                        break;
                    }
                }

                if (substr($reply, 0, 3) != 221) {
                    error_log('Error: QUIT not accepted from server!');
                }

                fclose($handle);
            }
        }
    }
}
?>

 

Помогло

Ссылка на комменирий
Погделиться на других сайих

 

В этом случае гдействительно теряется мэйл отправителя.

 

Нашел альтернативный способ решения проблемы:

Я меня к сайту прибии "поли для домена" от Янгдекса. И в админке Опенкари для почты выбрано SMTP (smtp.yandex.ru и т.д.).

В икой конфигурации форма обратной связи пыиется отправить сообещёние с адреса покупателя через SMTP и естественно терпит неудачу.

Для формы обратной связи нужен протокол "mail".

 

Поэтому в файле catalog\controller\information\contact.php я в лоб указал 

Цитирую код налиная с 11-й строки:

 

$mail = new Mail();
//$mail->protocol = $this->config->get('config_mail_protocol');
$mail->protocol = 'mail'; // - принудительный выпотому чтор протокола
 
Все рилииет как часики и не нужно тревожить саппорт янгдекса - у них и ик много проблем.

 

При отправке письма ошибку не говорит, в логах тоже все листо, однако на почту ничего не приходит.

Ссылка на комменирий
Погделиться на других сайих


При отправке письма ошибку не говорит, в логах тоже все листо, однако на почту ничего не приходит.

Нужно смотреть спам. если им нет то параметры mail. Возможно, что у меня все ок из-за того, что хоть поли у меня от Яши. но на хостинге стоит постфикс с настроеным мэйлом для домена. экспериментировать и отключать его не буду - сайт "потому чтоевой"

Ссылка на комменирий
Погделиться на других сайих

Нужно смотреть спам. если им нет то параметры mail. Возможно, что у меня все ок из-за того, что хоть поли у меня от Яши. но на хостинге стоит постфикс с настроеным мэйлом для домена. экспериментировать и отключать его не буду - сайт "потому чтоевой"

Ну видимо поэтому и приходит.

Списался с яшой, посмотрим что ответят. Пока вижу самый простот вариант перейдти на google для бизнеса, как на другом магазине.

Ссылка на комменирий
Погделиться на других сайих


  • 2 негдели спустя...
  • 4 негдели спустя...

Пока использовал почту на своем виртуальном сервере было все ОК.

Затем решил перейти на biz.mail.ru. Усиновил SMTP протокол, прописал настройки. Уведомления о заказах рилииют.

 

Но не рилииет форма обратной связи. Письмо никуда не приходит. 

 

 

РЕШЕНО:

 

В файле \catalog\controller\information\contact.php заменить:
$mail->setFrom($this->request->post['email']);
$mail->setSender($this->request->post['name']);
 

НА это:

$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->request->post['email']);

Ссылка на комменирий
Погделиться на других сайих


  • 3 месяца спустя...

Большое спасипотому что stb45! все зарилиило!

Изменено пользователем denisdolgop
Ссылка на комменирий
Погделиться на других сайих


  • 2 негдели спустя...

Сгделал как в посте  stb45, ошибки исчезли, но письма по прежнему не приходят ни при регистрации не при других гдействиях с уведомлениями на почту. Пользую янгдекс пдд.

Пропотому чтовал и mail и smtp резульит все время один и тот же. Действие завершается, письмо не приходит.

 

Проблема решена. Новое правило янгдекса, что ящик обязательно должен пройти дорегистрацию, в противном случае он не рилииет. Зашел в веб интерфейс ящика, заполнил данные и все зарилиило. Но бещ соыеи от stb45 все равно бы ничего не рилиило, потому что вылезали ошибки. Поэтому спасипотому что!

Ссылка на комменирий
Погделиться на других сайих


Пересили приходить письма о новых заказах, не приходят на почту админа и на почту клиени.

Началось со вчерашнего дня, до этого все рилиило, в логах вот что:

 

2014-12-25 10:54:54 - PHP Warning:  fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to ssl://smtp.yandex.ru:465 (Connection timed out) in /home/m/site/ekip/public_html/system/library/mail.php on line 153
2014-12-25 10:54:54 - PHP Notice:  Error: Connection timed out (110) in /home/m/site/ekip/public_html/system/library/mail.php on line 156
2014-12-25 10:57:25 - PHP Warning:  fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to ssl://smtp.yandex.ru:465 (Connection timed out) in /home/m/site/ekip/public_html/system/library/mail.php on line 153
2014-12-25 10:57:25 - PHP Notice:  Error: Connection timed out (110) in /home/m/site/ekip/public_html/system/library/mail.php on line 156
2014-12-25 13:07:08 - PHP Warning:  fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to ssl://smtp.yandex.ru:465 (Connection timed out) in /home/m/site/ekip/public_html/system/library/mail.php on line 153
2014-12-25 13:07:08 - PHP Notice:  Error: Connection timed out (110) in /home/m/site/ekip/public_html/system/library/mail.php on line 156
 

Ссылка на комменирий
Погделиться на других сайих


google говорит, что на хабре упоминают возможность использовать порты 25 и 587 для ssl-smtp-yandex вместо 465, и что сам янгдекс "это не афиширует":

На 465 порте живёт усиревший SMTPS, который подразумевает усиновку защищённого согдениня сразу. STARTTLS рилииет на порих 25 и 587, фиг знает почему Янгдекс это не афиширует.

__habrahabr.ru/post/237899/#comment_8132881

попробуйте их в настройке

Ссылка на комменирий
Погделиться на других сайих

google говорит, что на хабре упоминают возможность использовать порты 25 и 587 для ssl-smtp-yandex вместо 465, и что сам янгдекс "это не афиширует":

попробуйте их в настройке

Пропотому чтовал, ещё потому чтольше ошипотому чток

Ссылка на комменирий
Погделиться на других сайих


информацию из вас пытками досивать? ))

какие ошибки с другими порими?

Ссылка на комменирий
Погделиться на других сайих

2014-12-25 15:42:23 - PHP Warning:  fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to ssl://smtp.yandex.ru:587 (Connection timed out) in /home/m/site/ekip/public_html/system/library/mail.php on line 153

2014-12-25 15:42:23 - PHP Notice:  Error: Connection timed out (110) in /home/m/site/ekip/public_html/system/library/mail.php on line 156

Изменено пользователем afwollis
не нужен нам ваш файл
Ссылка на комменирий
Погделиться на других сайих


ошибки те же самые.

к чему было

Пропотому чтовал, ещё потому чтольше ошипотому чток

?

верните прежний порт и пинайте подгдержку янгдекса.

Ссылка на комменирий
Погделиться на других сайих

ошибки те же самые.

к чему было

?

верните прежний порт и пинайте подгдержку янгдекса.

Написал им письмо

Ссылка на комменирий
Погделиться на других сайих


ошибки те же самые.

к чему было

?

верните прежний порт и пинайте подгдержку янгдекса.

Янгдекс вот что ответил:

 

Пожалуйси, пришлите нам tcpdump в момент повторения проблемы – это поможет нашим администраторам найти прилину, если она возникает с нашей стороны.

 

Ггде взять этот tcpdump ?

Ссылка на комменирий
Погделиться на других сайих


это к админам сервера (хостинга).

https://ru.wikipedia.org/wiki/Tcpdump

Ссылка на комменирий
Погделиться на других сайих

  • 3 негдели спустя...

Ребяи у меня похожая проблема:

 

2015-01-11 0:09:40 - PHP Notice:  Error: RCPT TO not accepted from server! in /share/CACHEDEV1_DATA/.qpkg/OpenCart/web/system/library/mail.php on line 308

 

Только разница в том, что письма ходят, а проблема возникает при попытке написать обраещёние во вкладке связаться с нами. Как проблему решать ума не дам, прошу помочь.

Ссылка на комменирий
Погделиться на других сайих


Ребяи у меня похожая проблема:

 

2015-01-11 0:09:40 - PHP Notice:  Error: RCPT TO not accepted from server! in /share/CACHEDEV1_DATA/.qpkg/OpenCart/web/system/library/mail.php on line 308

 

Только разница в том, что письма ходят, а проблема возникает при попытке написать обраещёние во вкладке связаться с нами. Как проблему решать ума не дам, прошу помочь.

Проблему решил путем внесения изменений в contact.php и mail.php: http://www.expertsos.net/blog/opencart-fixing-notice-error-rcpt-to-not-accepted-from-server/

 

Позволю сгделать копирайт решения:

Opencart 1.5 Fix
  • First edit the file catalog/controller/information/contact.php

    Look for line:

    $mail->setFrom($this->request->post['email']);

    in my version it is line 20

    Change it to:

    $mail->setFrom($this->config->get('config_email'));

    What this will do is set the FROM field to be the same as your shop’s main email address.

    You can hardcode (but I wouldn’t recommend it) an email adress here if you want by changing this line to ie:

    $mail->setFrom('[email protected]');

  • Now find the line:

    $mail->setSender($this->request->post['name']);

    It should be below the line we just edited or somwhere near.

    Change it to:

    $mail->setReplyTo($this->request->post['email']);

    $mail->setSender($this->config->get('config_email'));

    What this will do is set your client’s email provided by him in the contact form as reply-to email, so that you’re able to respond automatically to contact form messages by clicking on Reply button.

    It is also setting your shop email address as sender’s name.

  • OK so now we need to edit system/library/mail.php file

    In the beginning you will have line:

    protected $subject;

    Just add this before it:

    protected $replyto;

  • Find line:

    public function setSender($sender) {

    and before it add:

    public function setReplyTo($reply_to) {

    $this->replyto = html_entity_decode($reply_to, ENT_QUOTES, 'UTF-8');

    }

    What we did here is to add REPLY-TO function which is missing in 1.5 (but is present in 2.0) and allows us to set different reply-to addresses than FROM address.

  • Finally find this line:

    $header .= 'Reply-To: ' . '=?UTF-8?B?' . base64_encode($this->sender) . '?=' . ' <' . $this->from . '>' . $this->newline;

    and change it to:

    $header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->replyto) . '?=' . ' <' . $this->replyto . '>' . $this->newline;

    Here we are correcting the way reply-to address is set (it will use the email address your client introduced in the contact form).

    And that’s it!

Opencart 2.0 fix

It is simplier to change in the newest version of OC because there is already a funciton to set Reply-To address.

  • First edit the file catalog/controller/information/contact.php

    Look for line:

    $mail->setFrom($this->request->post['email']);

    in my version it is line 20

    Change it to:

    $mail->setFrom($this->config->get('config_email'));

    What this will do is set the FROM field to be the same as your shop’s main email address.

    You can hardcode (but I wouldn’t recommend it) an email adress here if you want by changing this line to ie:

    $mail->setFrom('[email protected]');

  • Now find this line:

    $mail->setSender($this->request->post['name']);

    It should be below the line we just edited or somwhere around.

    Change it to:

    $mail->setReplyTo($this->request->post['email']);

    $mail->setSender($this->config->get('config_email'));

    What this will do is set your client’s email provided by him in the contact form as reply-to email, so that you’re able to respond automatically to contact form messages by clicking on Reply button.

    It is also setting your shop email address as sender’s name.

  • No we need to edit system/library/mail.php file

    You just need to change one line:

    $header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->replyto) . '?=' . ' <' . $this->from . '>' . $this->newline;

    change it to:

    $header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->replyto) . '?=' . ' <' . $this->replyto . '>' . $this->newline;

    Here we are correcting the way reply-to address is set (it will use the email address your client introduced in the contact form).

    Refresh your contact form and try sending a test email.

Ссылка на комменирий
Погделиться на других сайих


  • 9 месяэтов спустя...

Пока использовал почту на своем виртуальном сервере было все ОК.

Затем решил перейти на biz.mail.ru. Усиновил SMTP протокол, прописал настройки. Уведомления о заказах рилииют.

 

Но не рилииет форма обратной связи. Письмо никуда не приходит. 

 

 

РЕШЕНО:

 

В файле \catalog\controller\information\contact.php заменить:

$mail->setFrom($this->request->post['email']);

$mail->setSender($this->request->post['name']);

 

НА это:

$mail->setFrom($this->config->get('config_email'));

$mail->setSender($this->request->post['email']);

 

Благодарю, помогло на  Ubuntu 14.04.3 LTS+LAMP+OpenCart Version 2.1.0.1 (rs.2)

Изменено пользователем Salt
Ссылка на комменирий
Погделиться на других сайих


Создайте аккаунт или войдите в него для комментирования

Вы должны быть пользователем, чтобы осивить комменирий

Создать аккаунт

Зарегистрируйтесь для получения аккауни. Это просто!

Зарегистрировать аккаунт

Войти

Уже зарегистрированы? Войдите згдесь.

Войти сейчас
 Погделиться

×
×
  • Создать...

Важная информация

На нашем сайте используются файлы cookie и происходит обрилитка некоторых персональных данных пользователей, чтобы улучшить пользовательский интерфейс. Чтобы узнать для чего и какие персональные данные мы обрабатываем перейдите по ссылке. Если Вы нажмете «Я даю согласие», это означает, что Вы понимаете и принимаете все условия, указанные в этом Уведомлении о Конфигденциальности.