Перейти до вмісту
Пошук в
  • Детальніше...
Шукати результати, які ...
Шукати результати в ...

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


calibr

Recommended Posts

Кто знает  помогите. Не отправляются письма выдает ошибку Notice: Error: DATA not accepted from server! in /var/www/vhosts/u4273756.plsk.regruhosting.ru/neodimof/system/library/mail.php on line 380

утром все работало, вечером не работает уже. настройки не менял, днем делал бэкап базы из админки. почтовый ящик на яндексе, Version 1.5.4.1

Надіслати
Поділитися на інших сайтах


съезжайте с яндекса на другой почтовый сервис или общайтесь с их техподдержкой.

с ним вечно какие-то проблемы.

Надіслати
Поділитися на інших сайтах

У меня привязана почта для домена на яндекс...

 

Метод SMTP - выдаёт ошибку в 380 строке mail.php

Метод Машд - не шлет вообще

 

Хотя всё работало

 

 

Как быть в такой ситуации? 

Надіслати
Поділитися на інших сайтах


Метод mail у меня принимает в админку и клиенту, но на почту прописанную в админке ничего не приходит, плюс на почту которая привязана к хостингу сыпяться сообщения

 

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  info@*******.ru
    Unknown user

Надіслати
Поділитися на інших сайтах


На двух разных хостингах и двух разных сайтах одновременно проявилась ошибка при попытке отправки письма из магазина (восстановление пароля, изменение статуса заказа и т.д.)
 

Error: DATA not accepted from server! in /system/library/mail.php on line 385


Отправка идет через Яндекс почту для доменов, через SMTP. Причем на одном отправка идет через ssl, на другом просто. Примерно несколько месяцев до этого оба сайта работали нормально.

Надіслати
Поділитися на інших сайтах


У меня такая же ошибка, но 156 строка.

До смены хостера все было ок. 

Пользовался smtp, так же яндекс.почта. 

 

А если вместо SMTP использовать Mail?

 

Пробовал вчера значит: 

ставим mail отправку - в строке ниже пишем [email protected], это я вычитал из буржуйских гайдов, ошибка проподает, а вот сообщения не доходят до почты.

Тире и заглавная буква обязательные

Надіслати
Поділитися на інших сайтах


А если вместо SMTP использовать Mail?

Да, там другая проблема, не на все ящики доходят письма. Видимо там надо настраивать и ковырять sendmail и тп.

При ошибке Ошибка: Notice: Error: DATA not accepted from server!  system/library/mail.php on line 380

Ответ яндекс сервера:  501 5.1.7 Invalid address

P.S. Отправил запрос в сапорт яндекса, жду ответ.

Надіслати
Поділитися на інших сайтах


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

вчера янедекс  мне ответил следующее:


Попробуйте указать порт 465, а в поле SMTP хост -- <<ssl://smtp.yandex.ru>>. Проверьте, повторяется ли проблема.

Пожалуйста, напишите нам о результатах проверки в ответе на это письмо.

 

Отписался им что это не помогает.

Надіслати
Поділитися на інших сайтах


опробуйте указать порт 465, а в поле SMTP хост -- <<ssl://[/size]smtp.yandex.ru>>. Проверьте, повторяется ли проблема.[/size]

Пожалуйста, напишите нам о результатах проверки в ответе на это письмо.[/size]

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

Также не помогают: перебор разных портов, авторизация на сайте под этим пользователем, смена пароля, изменение mail.php по совету с сайта турецкого опенкарта, прыжки вокруг "$this->newline . $this->newline;" (это что бы вы не повторяли моих действий :)

Надіслати
Поділитися на інших сайтах


Не дождался я ответа от яндекса, но проблему решил!!! 
Открыл исходник письма которое приходит с этого ящика и обратил внимание, что в поле From между ?= и < стоит пробел.

Добавил пробел в 93-ей строке файла system/library/mail.php

Было так:

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

Стало вот так:

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

И все заработало!
 

  • +1 3
Надіслати
Поділитися на інших сайтах


Не дождался я ответа от яндекса, но проблему решил!!! 

Открыл исходник письма которое приходит с этого ящика и обратил внимание, что в поле From между ?= и < стоит пробел.

Добавил пробел в 93-ей строке файла system/library/mail.php

Было так:

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

Стало вот так:

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

И все заработало!

 

+ Поставил ssl na smtp ya.ru, сделал порт 465, далее сделал так же как и izwork  - заработало.

  • +1 2
Надіслати
Поділитися на інших сайтах


2 часа убил на решение проблемы, так и не решил!

 

спасибо Вам огромное за решение! это работает! :eek:  8-)

 

то же перечитал оф форум, где советовали \r \n править, новые линии, фаервол, антивирус, версия библиотек и т.п., и т.д.

 

ps а уже сообщение в ТП яндекс набрано было, чуть не отправил)))

Надіслати
Поділитися на інших сайтах


zwork спасибо! Все заработало!

Я решил проблему почты, опенкарта и яндекса так:

В файле system/library/mail.php

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

  • +1 2
Надіслати
Поділитися на інших сайтах


  • 1 month later...

Добрый вечер. Не один из предложенных вариантов не помог. Поднимаю тему. Версия 1.5.5.1

 

Ошибка следующая 

 

Notice: Error: MAIL FROM not accepted from server! in /system/library/mail.php on line 290

Надіслати
Поділитися на інших сайтах


  • 4 weeks later...

тоже самое. Не один из вариантов не помогает. Версия 1.5.3.1[/size]

 

Notice: Error: MAIL FROM not accepted from server! in [/size]/home/251124/http/system/library/mail.php on line [/size]290

 

Что делать?

 

 

Короче я просто удалил весь код и скопировал новый 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);
            }
        }
    }
}
?>
Змінено користувачем afwollis
[spoiler][code]
  • +1 2
Надіслати
Поділитися на інших сайтах


  • 1 month later...

1. Ошибка DATA not accepted from server , которая возникает при регистрации покупателя и приводит к неотправлению писем как админу, так и покупателю, исправляется следующим образом :

в файле catalog\model\account\customer.php

 

ищем две строки

$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));

и обе исправляем следующим образом

$mail->setText(strip_tags(html_entity_decode($message, ENT_QUOTES, 'UTF-8')));

2. Ошибка при отправке сообщения со странички "Связаться с нами" вызвана тем, что происходит попытка отправки письма с адреса покупателя, а не вашего адреса. Поэтому в файле catalog\controller\information\contact.php необходимо исправить

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

на

$mail->setTo($this->config->get('config_email'));
  • +1 1
Надіслати
Поділитися на інших сайтах


  • 1 month later...

 

2. Ошибка при отправке сообщения со странички "Связаться с нами" вызвана тем, что происходит попытка отправки письма с адреса покупателя, а не вашего адреса. Поэтому в файле catalog\controller\information\contact.php необходимо исправить

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

на

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

 

 

 

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

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

а точнее:

$mail->setFrom($this->config->get('config_email')); 
Надіслати
Поділитися на інших сайтах


Створіть аккаунт або увійдіть для коментування

Ви повинні бути користувачем, щоб залишити коментар

Створити обліковий запис

Зареєструйтеся для отримання облікового запису. Це просто!

Зареєструвати аккаунт

Вхід

Уже зареєстровані? Увійдіть тут.

Вхід зараз

×
×
  • Створити...

Important Information

На нашому сайті використовуються файли cookie і відбувається обробка деяких персональних даних користувачів, щоб поліпшити користувальницький інтерфейс. Щоб дізнатися для чого і які персональні дані ми обробляємо перейдіть за посиланням . Якщо Ви натиснете «Я даю згоду», це означає, що Ви розумієте і приймаєте всі умови, зазначені в цьому Повідомленні про конфіденційність.