Uncaught phpmailerexception smtp error data not accepted

I'm trying to figure out this issue for 6 hours. But there is nothing to make sense. Here is the scenario; There is a well formatted HTML template. $mail_body = ' Message Num :</b&...

I’m trying to figure out this issue for 6 hours. But there is nothing to make sense. Here is the scenario; There is a well formatted HTML template.

$mail_body = '
    <b>Message Num :</b> 769<br />
    <b>Message Date :</b> 2013-04-08 09:03:21<br />
    <b>Name :</b> John Doe<br />
    <b>Phone :</b> 123456789<br />
    <b>E-mail :</b> abcdf@somedomain.com<br />
    <b>Message :</b> Here is the message info<br />
';

Here is the array of recipients’ mails;

$recipients = array("abc@something.com","xyz@somtehing.com");

Everything looks fine and email ready to send.Here is the phpmailer config;

$mail = new PHPMailer(); 
$mail->IsSMTP();
$mail->From = "noreply@something.com"; 
$mail->FromName = "TEST";
$mail->WordWrap = 50;

foreach($recipients as $mail_add) {
    $mail->AddAddress($mail_add);
}
$mail->IsHTML(true);
$mail->Subject = "TEST Subject";
$mail->Body = $mail_body;
if(!$mail->Send()) {
    echo $mail->ErrorInfo;
} else { 
        echo "Mail sent...";
}

Everything is same when I test it. But sometimes email was sent. Sometimes it was not sent. Give me the following error : The following SMTP Error: Data not accepted.

I hope I explained

asked Apr 8, 2013 at 13:14

Yasin Yörük's user avatar

12

your server dosen’t allow different sender and username
you should config: $mail->From like $mail->Username

pb2q's user avatar

pb2q

57.6k18 gold badges145 silver badges146 bronze badges

answered Jan 2, 2014 at 16:54

J Ha's user avatar

J HaJ Ha

1,15212 silver badges16 bronze badges

7

set phpmailer to work in debug to see the «real» error behind the generic message ‘SMTP Error: data not accepted’ in our case the text in the message was triggering the smtp server spam filter.

  $email->SMTPDebug = true;

answered Feb 4, 2016 at 9:46

zzapper's user avatar

zzapperzzapper

4,6735 gold badges47 silver badges45 bronze badges

1

For AWS users who work with Amazon SES in conjunction with PHPMailer, this error also appears when your «from» mail sender isn’t a verified sender.

To add a verified sender:

  1. Log in to your Amazon AWS console: https://console.aws.amazon.com

  2. Select «Amazon SES» from your list of available AWS applications

  3. Select, under «Verified Senders», the «Email Addresses» —> «Verify a new email address»

  4. Navigate to that new sender’s email, click the confirmation e-mail’s link.

And you’re all set.

Uwe Keim's user avatar

Uwe Keim

39k56 gold badges175 silver badges289 bronze badges

answered Aug 29, 2014 at 1:21

Jonathan LeRoux's user avatar

2

Interestingly, I had the same exact issue and for me the problem was that my connection was timing out. To be able to see more details on my connections, I added $mail->SMTPDebug = 4; to my phpmailer (look up how to capture the debug since the default output function is echo).

Here’s the result:

SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is ""
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): timed-out (10 seconds)
SMTP -> FROM SERVER:
SMTP -> ERROR: DATA not accepted from server: 

The default timeout is set to 10 seconds. If your app can support more, add this line to your phpmailer:

$mail->Timeout = 20;

Nicolas Raoul's user avatar

answered Mar 8, 2017 at 16:22

phoenix's user avatar

phoenixphoenix

1,52119 silver badges11 bronze badges

3

Over a certain message of size, it messes up the content when setting through $mail->Body.

You can test it, if it works well with small messages, but doesn’t work with larger (over 4-6 kB), then this is the problem.

It seems to be the problem of $mail->Body, so you can get around this by setting the HTML body manually via $mail->MsgHTML($message). And then you can try to only add the non-html body by $mail->AltBody.

Hope that I could help, feel free to provide more details, information.

answered Apr 12, 2013 at 15:36

Adam Szabo's user avatar

Adam SzaboAdam Szabo

11.2k18 gold badges63 silver badges100 bronze badges

1

I was using just

$mail->Body    = $message;

and for some sumbited forms the PHP was returning the error:

SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: This message was classified as SPAM and may not be delivered
SMTP code: 550

I got it fixed adding this code after $mail->Body=$message :

$mail->MsgHTML = $message;
$mail->AltBody = $message;

answered Mar 22, 2018 at 17:00

André A.'s user avatar

3

Try to set the port on 26, this has fixed my problem with the message «data not accepted».

answered Dec 5, 2014 at 15:06

Matteo's user avatar

We send email via the Gmail SMTP servers, and we get this exact error from PHPMailer sometimes when we hit our Gmail send limits.

You can check if it’s the same thing happening to you by going into Gmail and trying to manually send an email. In our case that displays the more helpful error message about sending limits.

https://support.google.com/a/answer/166852?hl=en

answered Jul 18, 2017 at 6:08

brismuth's user avatar

brismuthbrismuth

34.7k3 gold badges34 silver badges37 bronze badges

I was hitting this error with phpMailer + Amazon SES. The phpMailer error is not very descriptive:

2: message: SERVER -> CLIENT: 554 Transaction failed: Expected ';', got ""
1: message: 
2: message: SMTP Error: data not accepted.

For me the issue was simply that I had the following as content type:

$phpmailer->ContentType = 'text/html; charset=utf-8rn';

But that it shouldn’t have the linebreak in it:

$phpmailer->ContentType = 'text/html; charset=utf-8';

… I suspect this was legacy code from our older version. So basically, triple check every $phpmailer setting you’re adding — the smallest detail counts.

answered Feb 26, 2019 at 14:37

Woody Hayday's user avatar

First you better set debug to TRUE:

$email->SMTPDebug = true;

Or temporary change value of public $SMTPDebug = false; in PHPMailer class.

And then you can see the full log in the browser.
For me it was too many emails per second:

...
SMTP -> FROM SERVER:XXX.XX.XX.X Ok
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "XXX.XX.XX.X Requested action not taken: too many emails per second "
SMTP -> get_lines(): $data is "XXX.XX.XX.X Requested action not taken: too many emails per second "
SMTP -> FROM SERVER:XXX.XX.XX.X Requested action not taken: too many emails per second
SMTP -> ERROR: DATA command not accepted from server: 550 5.7.0 Requested action not taken: too many emails per second
...

Thus I got to know what was the exact issue.

Nicolas Raoul's user avatar

answered May 9, 2019 at 11:52

Sadee's user avatar

SadeeSadee

2,92435 silver badges36 bronze badges

I was experiencing this same problem. In my instance the send mail was timing out because my Exchange server was relaying email to a server on the internet. That server had exceeded it’s bandwidth quota. Apparently php mailer has some built in timeout and it wasn’t long enough to see the actual message.

answered Nov 19, 2013 at 2:50

geekinit's user avatar

geekinitgeekinit

1,3452 gold badges14 silver badges17 bronze badges

In my case in cpanel i have ‘Register mail ids’ option where i add my email address and after 30 minutes it works fine with simple php mail function.

answered Feb 7, 2019 at 13:15

Dinesh Gurjar's user avatar

If you are using the Office 365 SMTP gateway then «SMTP Error: data not accepted.» is the response you will get if the mailbox is full (even if you are just sending from it).

Try deleting some messages out of the mailbox.

answered Mar 6, 2019 at 9:06

beingalex's user avatar

beingalexbeingalex

2,3964 gold badges31 silver badges70 bronze badges

In my case the problem was with the content of mail. When I changed content to simpler content without HTML, it worked. But after updating the phpmailer everything solved.

answered Mar 7, 2019 at 12:32

NightOwl's user avatar

NightOwlNightOwl

3292 silver badges20 bronze badges

in my case I was using AWS SES and I had to verify both «FromEmail» and «Recipient». Once done that I could send without problems.

answered Feb 5, 2020 at 4:04

Gabriel Cortes's user avatar

Mailgun sanbox error

With $PHPMailer->SMTPDebug = true; I found out that when using the mailgun sandbox domain, the email has to be added to an authorized recipients list (which is on the right panel of the sandbox domain overview)

answered Jun 1, 2021 at 7:25

Samuel Gfeller's user avatar

It happen too, when you used stripslashes or addslashesh or real_escape_string.

Avoid these things inside email body, when your email execution code completed then you can add these lines in bottom.

answered Mar 2, 2022 at 15:29

Saif Warsi's user avatar

1

My team has been encountering this error intermittently on a lot of our sites and in our case I was finally able to track it down; in our case it appears that the 10 second SMTP timeout is sometimes just a hair too short for our outbound SMTP server (related: https://www.drupal.org/project/smtp/issues/2781157)

I figured it out by editing smtp.transport.inc to include the following code around line ~432, and then spamming the webform using `curl`:

    // message data has been sent
    $out .=  date("h:i:s") . " finish up...n";
    fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF);

    $out .=  date("h:i:s") . " get_lines()...n";
    $rply = $this->get_lines();
    $out .=  date("h:i:s") . " rply2: $rply";
    $code = substr($rply, 0, 3);

    if ($this->do_debug >= 2) {
      drupal_set_message(t("SMTP -> FROM SERVER: @rply", array("@rply" => $rply)));
    }

    if ($code != 250) {
      $out .=  "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%n";
      $out .=  date("h:i:s") . " DONE DIDDLY ERRORED!!!!!!!!!! $code != 250n";
      $out .=  "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%n";

      $i = 1;
      while($code != 250) {
        $out .=  date("h:i:s") . " Waiting $i...n";
        sleep(1);
        $out .=  date("h:i:s") . " How about now?n";
        $rply = $this->get_lines();
        $out .=  date("h:i:s") . " rply2: $rply";
        $code = substr($rply, 0, 3);
      }
      $out .=  date("h:i:s") . " FINALLY!! sheeshnn";
      echo "$outn";

When the error happens, this is the output that comes back via curl:

03:53:39 finish up...
03:53:39 get_lines()...
03:53:49 rply2: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03:53:49 DONE DIDDLY ERRORED!!!!!!!!!!  != 250
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03:53:49 Waiting 1...
03:53:50 How about now?
03:53:50 rply2: 250 2.6.0 <47719fb32b58d96d14107b6a57b60b3f@appserver-1243c6d4.c.pantheon-dmz.internal> [InternalId=449543965] Queued mail for delivery
03:53:50 FINALLY!! sheesh

Notice how it descends into the error condition exactly 10 seconds after calling `get_lines()` and apparently waiting just one more second is enough for our mail server to respond.

The error behavior we were seeing was the same as NancyDru’s.. «Data not accepted» and no SMTP error message. In our case it’s because the mail server didn’t reply in time.

Hope this helps someone…

I’ve been trying for hours to get PHP Mailer to work, but I keep getting;

2018-03-06 10:18:28 SMTP ERROR: DATA END command failed: 550 This message was classified as SPAM and may not be delivered
SMTP Error: data not accepted.
Message could not be sent. Mailer Error: SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: This message was classified as SPAM and may not be delivered SMTP code: 550

This is the code I am using to send the email through my sites mail thingy.

require '../ipn/PHPMailer-master/src/Exception.php';
require '../ipn/PHPMailer-master/src/PHPMailer.php';
require '../ipn/PHPMailer-master/src/SMTP.php';

$mail = new PHPMailer(true);                              // Passing `true` enables exceptions
try {
    //Server settings
    $mail->SMTPDebug = 2;                                 // Enable verbose debug output
    $mail->isSMTP();                                      // Set mailer to use SMTP
    $mail->Host = 'mail.site.pw';  // Specify main and backup SMTP servers
    $mail->SMTPAuth = true;                               // Enable SMTP authentication
    $mail->Username = 'magnolia@site.pw';                 // SMTP username
    $mail->Password = 'removed';                           // SMTP password
    $mail->SMTPSecure = 'ssl';                            // Enable TLS encryption, `ssl` also accepted
    $mail->Port = 465;                                    // TCP port to connect to
    
    $mail->setFrom('magnolia@antrax.pw');
    $mail->addAddress('lunasityboi@gmail.com');               // Name is optional
    
    //Content
    $mail->isHTML(true);                                  // Set email format to HTML
    $mail->Subject = 'Here is the subject';
    $mail->Body    = 'This is the HTML message body <b>in bold!</b>';
    $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

    $mail->send();
    echo 'Message has been sent';
} catch (Exception $e) {
    echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
}

This is what I get from debugging;

2018-03-06 10:18:28 SERVER -> CLIENT: 220-cpanel.hostslayer.com ESMTP Exim 4.89_1 #1 Tue, 06 Mar 2018 02:18:28 -0800 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
2018-03-06 10:18:28 CLIENT -> SERVER: EHLO antrax.pw
2018-03-06 10:18:28 SERVER -> CLIENT: 250-cpanel.hostslayer.com Hello antrax.pw [192.152.0.152]250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN250 HELP
2018-03-06 10:18:28 CLIENT -> SERVER: AUTH LOGIN
2018-03-06 10:18:28 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2018-03-06 10:18:28 CLIENT -> SERVER: <credentials hidden>
2018-03-06 10:18:28 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2018-03-06 10:18:28 CLIENT -> SERVER: <credentials hidden>
2018-03-06 10:18:28 SERVER -> CLIENT: 235 Authentication succeeded
2018-03-06 10:18:28 CLIENT -> SERVER: MAIL FROM:<magnolia@antrax.pw>
2018-03-06 10:18:28 SERVER -> CLIENT: 250 OK
2018-03-06 10:18:28 CLIENT -> SERVER: RCPT TO:<lunasityboi@gmail.com>
2018-03-06 10:18:28 SERVER -> CLIENT: 250 Accepted
2018-03-06 10:18:28 CLIENT -> SERVER: DATA
2018-03-06 10:18:28 SERVER -> CLIENT: 354 Enter message, ending with "." on a line by itself
2018-03-06 10:18:28 CLIENT -> SERVER: Date: Tue, 6 Mar 2018 10:18:28 +0000
2018-03-06 10:18:28 CLIENT -> SERVER: To: lunasityboi@gmail.com
2018-03-06 10:18:28 CLIENT -> SERVER: From: magnolia@antrax.pw
2018-03-06 10:18:28 CLIENT -> SERVER: Subject: Here is the subject
2018-03-06 10:18:28 CLIENT -> SERVER: Message-ID: <uW9WATC68PHGC9hZlxf2mCKPzDFtWMnssWKM4rJDuY@antrax.pw>
2018-03-06 10:18:28 CLIENT -> SERVER: X-Mailer: PHPMailer 6.0.3 (https://github.com/PHPMailer/PHPMailer)
2018-03-06 10:18:28 CLIENT -> SERVER: MIME-Version: 1.0
2018-03-06 10:18:28 CLIENT -> SERVER: Content-Type: multipart/alternative;
2018-03-06 10:18:28 CLIENT -> SERVER: boundary="b1_uW9WATC68PHGC9hZlxf2mCKPzDFtWMnssWKM4rJDuY"
2018-03-06 10:18:28 CLIENT -> SERVER: Content-Transfer-Encoding: 8bit
2018-03-06 10:18:28 CLIENT -> SERVER: 
2018-03-06 10:18:28 CLIENT -> SERVER: This is a multi-part message in MIME format.
2018-03-06 10:18:28 CLIENT -> SERVER: --b1_uW9WATC68PHGC9hZlxf2mCKPzDFtWMnssWKM4rJDuY
2018-03-06 10:18:28 CLIENT -> SERVER: Content-Type: text/plain; charset=us-ascii
2018-03-06 10:18:28 CLIENT -> SERVER: 
2018-03-06 10:18:28 CLIENT -> SERVER: This is the body in plain text for non-HTML mail clients
2018-03-06 10:18:28 CLIENT -> SERVER: 
2018-03-06 10:18:28 CLIENT -> SERVER: --b1_uW9WATC68PHGC9hZlxf2mCKPzDFtWMnssWKM4rJDuY
2018-03-06 10:18:28 CLIENT -> SERVER: Content-Type: text/html; charset=us-ascii
2018-03-06 10:18:28 CLIENT -> SERVER: 
2018-03-06 10:18:28 CLIENT -> SERVER: This is the HTML message body <b>in bold!</b>
2018-03-06 10:18:28 CLIENT -> SERVER: 
2018-03-06 10:18:28 CLIENT -> SERVER: 
2018-03-06 10:18:28 CLIENT -> SERVER: --b1_uW9WATC68PHGC9hZlxf2mCKPzDFtWMnssWKM4rJDuY--
2018-03-06 10:18:28 CLIENT -> SERVER: 
2018-03-06 10:18:28 CLIENT -> SERVER: .
2018-03-06 10:18:28 SERVER -> CLIENT: 550 This message was classified as SPAM and may not be delivered
2018-03-06 10:18:28 SMTP ERROR: DATA END command failed: 550 This message was classified as SPAM and may not be delivered
SMTP Error: data not accepted.
Message could not be sent. Mailer Error: SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: This message was classified as SPAM and may not be delivered SMTP code: 550

  • #1

почта приходит не на все email mail() phpmailer

Пробую использовать phpmailer.
Использую mail и sendmail — почему не приходит на все e-mail
Например на gmail нормально приходит, а на yandex не приходит

c0dex


  • #2

Код где?
То, что твой ip/сервер откуда шлешь может быть в блэк-листе не думал?

  • #3

PHP:

<?php    require_once('../class.phpmailer.php');    
$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch  $mail->IsSendmail(); // telling the class to use SendMail transport    
try {    $mail->AddReplyTo('', 'First Last');    
$mail->AddAddress('', 'John Doe');   
 $mail->SetFrom('', 'First Last');  
  $mail->AddReplyTo('', 'First Last');    
$mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
 $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically   
 $mail->MsgHTML(file_get_contents('contents.html'));   
 $mail->AddAttachment('images/phpmailer.gif');      // attachment   
 $mail->AddAttachment('images/phpmailer_mini.gif'); // attachment  
  $mail->Send();    echo "Message Sent OK</p>n";  } catch (phpmailerException $e) {    echo $e->errorMessage(); //Pretty error messages from PHPMailer  } catch (Exception $e) {    echo $e->getMessage(); //Boring error messages from anything else!  }  ?>

вот код. отправляю с хостинга godaddy.com

-~{}~ 11.02.10 18:34:

пробую smtp пишет ошибку

SMTP -> ERROR: DATA not accepted from server: 554 The message was rejected because it contains prohibited virus or spam content
SMTP Error: Data not accepted. Mailer Error: SMTP Error: Data not accepted.

SMTP server error: The message was rejected because it contains prohibited virus or spam content

Отправляю только текст небольшой

-~{}~ 11.02.10 18:41:

хотя на сайте стоит wordpress он тоже работает через phpmailer — отправляется все нормально и на яндекс.

  • #4

мне, кстати, очень помогла установка spam_assasin на проверку ОТПРАВЛЯЕМОЙ почты. Я просто смотрел в отлупах заголовки своего spam_assasin-а и что ему наиболее не понравилось в письме. Это может быть и кривая кодировка заголовков (и их длинна) и большие буквы в заголовках и многое другое. Ну и, конечно, поле from должно быть живым email-ом и отправляться через сервер, который обслуживает именно этот домен. Ну и читать нужно отлупы, получаемые на from. Поэтому посылать нужно с адресов типа [email protected] или [email protected], а если нужен ответ конкретному человеку, то писать его в reply-to.

grigori


  • #6

grigori, а случайно вышло, по дефолту в CentOS + exim он прикрутился у меня на всю, а не только принимаемую почту, но свою почту он всегда пропускал, так как 127.0.0.1 был в white list и давал много отрицательных баллов. Понял что происходит только когда начал анализировать отлупы и находить в них заголовки от своего spam_assasin-а и впечатлился, после чего заюзал практически для правки шаблонов сообщений.

  • #7

так а как же тогда отправляют плагины в wordpress.
на gmail стабильно все прихоит, на mail.ru тоже.
на yandex никак

  • #8

goacher, ты думать самостоятельно будешь? Не святым духом, это уж точно. Посмотри на заголовки и тело письма, которое посылает wordpress и которые «доходят» и сравни с теми, что «не доходят». Найди различия и устрани, если предыдущие советы до тебя не дошли.

  • #9

а как посмотреть заголовки писем, которые доходят?

  • #10

goacher, тебя тут учить основам компьютерной грамотности и навыкам работы с почтовыми клиентами?

  • #11

X-Yandex-FolderName: Vhodyashchie
Received: from mxfront21.mail.yandex.net ([127.0.0.1])
by mxfront21.mail.yandex.net with LMTP id ucsmjfOH
for [email protected]; Fri, 12 Feb 2010 15:56:38 +0300
Received: from p3smtphosting01-02.prod.phx3.secureserver.net (p3smtphosting01-02.prod.phx3.secureserver.net [208.109.80.27])
by mxfront21.mail.yandex.net (Yandex) with SMTP id EAF3A1ED00FA
for <[email protected]>; Fri, 12 Feb 2010 15:56:37 +0300 (MSK)
Received: (qmail 19597 invoked from network); 12 Feb 2010 12:56:36 -0000
Received: from p3slh143.shr.phx3.secureserver.net ([208.109.181.225])
(envelope-sender <[email protected]>)
by p3smtphosting01-02.prod.phx3.secureserver.net (qmail-ldap-1.03) with SMTP
for <[email protected]>; 12 Feb 2010 12:56:36 -0000
Received: from p3slh143.shr.phx3.secureserver.net (localhost.localdomain [127.0.0.1])
by p3slh143.shr.phx3.secureserver.net (8.12.11.20060308/8.12.11) with ESMTP id o1CCuZw2007335;
Fri, 12 Feb 2010 05:56:35 -0700
Received: (from [email protected])
by p3slh143.shr.phx3.secureserver.net (8.12.11.20060308/8.12.11/Submit) id o1CCuZ7d007329;
Fri, 12 Feb 2010 05:56:35 -0700
To: [email protected]
Subject: =?utf-8?B?QyDRgdCw0LnRgtCwINCT0L7RgdGC0LjQvdC40YbRiw==?=
Date: Fri, 12 Feb 2010 05:56:35 -0700
From: =?utf-8?B?0JPQvtGB0YLQuNC90LjRhtCwINCyINCg0L7Qs9Cw0YfQtdCy0LU=?= <[email protected]>
Message-ID: <[email protected]>
X-Priority: 2
X-Mailer: cformsII (deliciousdays.com) [version 10.5]
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=»utf-8″
X-Yandex-TimeMark: 1265979398
X-Yandex-Spam: 1
X-Yandex-Front: mxfront21.mail.yandex.net

вот заголовки, почты, которая доходит нормально.
Как мне правильно написать чтобы моя почат доставилась…
Спасибо.

  • #12

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

Код:

To: [email][email protected][/email]
Subject: =?utf-8?B?QyDRgdCw0LnRgtCwINCT0L7RgdGC0LjQvdC40YbRiw==?=
Date: Fri, 12 Feb 2010 05:56:35 -0700
From: =?utf-8?B?0JPQvtGB0YLQuNC90LjRhtCwINCyINCg0L7Qs9Cw0YfQtdCy0LU=?= <[email protected]>
X-Priority: 2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="utf-8"

  • #13

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

  • #14

Автор оригинала: Sigorma
goacher
если приведенный тобою список заголовков позволяет получать нормально почту, то сформируй из этого списка в ручную письмо и после каждой отправки отсекай явно лишние заголовки. в результате будет тебе минимально необходимый список заголовков.

PHP:

To: [email][email protected][/email]  Subject: =?utf-8?B?QyDRgdCw0LnRgtCwINCT0L7RgdGC0LjQvdC40YbRiw==?=  Date: Fri, 12 Feb 2010 05:56:35 -0700  From: =?utf-8?B?0JPQvtGB0YLQuNC90LjRhtCwINCyINCg0L7Qs9Cw0YfQtdCy0LU=?= <[email protected]>  X-Priority: 2  MIME-Version: 1.0  Content-Transfer-Encoding: 8bit  Content-Type: text/plain; charset="utf-8"

а как это все написать в mail ()?

  • #15

goacher, не дури. ты будешь контролировать длину заголовков, резать из при надобности, кодировать и все прочее делать руками? кроме того, не будешь иметь возможность слать почту через smtp и все это только потому, что тебе лень разобраться как пользоваться phpmailer-ом?

  • #16

goacher
читаем [m]mail[/m] mail

  • #17

а может есть у кого то настроенный phpmailer, чтобы приходили письма на все адреса?
спасибо.

  • #18

goacher
ты пробовал исправить свой скрипт после прочтения выше указанных ссылок где собственно есть ответы на все вопросы которые могут возникнуть?

  • #19

да, конечно. Судя по рабочим плагинам
From используется такой «»Титл главной страницы сайта» <[email protected]домен.ru>»

я попробовал в phpmailer

$mail->AddReplyTo(’email рабочий’, ‘Титл главной страницы сайта» <[email protected]домен.ru>»‘);
$mail->AddAddress(‘мой [email protected]’, »);
$mail->SetFrom(’email рабочий’, ‘Титл главной страницы сайта» <[email protected]домен.ru>»‘);
$mail->AddReplyTo(’email рабочий’, ‘Титл главной страницы сайта» <[email protected]домен.ru>»‘);

аналогичный результат

Crys

Crys

Двинутый новичок


  • #20

И что с того, что ты попробовал в phpmailer? Какие данные у тебя отсылаются в результате?




  • hus_hmd

  • May 20th 2019

  • Thread is marked as Resolved.
    • #1

    Hi,

    I’m getting a SMTP error when testing emails via the control panel.

    What does the error «SMTP Error: data not accepted» mean? Does it mean Perch successfully connected to the SMTP server, but the server rejected the data?

    • #2

    Solved.

    The email address PERCH_EMAIL_FROM in config didn’t match the SMTP username PERCH_EMAIL_USERNAME.

    • #3

    This happens in PHPMailer, so not my wheelhouse, but the code that throws the exception is this:

    1. <?php
    2. // Only send the DATA command if we have viable recipients
    3. if ((count($this->all_recipients) > count($bad_rcpt)) and !$this->smtp->data($header . $body)) {
    4. throw new phpmailerException($this->lang(‘data_not_accepted’), self::STOP_CRITICAL);
    5. }

    So looks like that throws if there’s no good recipients of if PHPMailer_SMTP::data() returns false.

    That method appears to be the part that actually sends the content of the message over the created SMTP connection. Anything going wrong in that process will result in the above error, including timeouts.

    It looks like the connection can be made and authenticated, but for some reason the server isn’t accepting the headers and body of the message.

    • #4

    Thanks for taking the time to explain this, Drew.

    This is the first time I’m sending emails via Office365. HESK’s documentation for setting up Office365 SMTP suggested the from email address should match the SMTP username and that has indeed solved the issue.

    So perhaps this is specific to Office365.

Понравилась статья? Поделить с друзьями:
  • Uncaught pdoexception could not find driver как исправить
  • Uncaught in promise error request failed with status code 500
  • Uncaught in promise error cannot find module
  • Uncaught guzzlehttp exception requestexception curl error 60 ssl certificate problem
  • Uncaught exception out of memory error