Problem with SMTP phpmailer

Asked

Viewed 411 times

2

I’m making the following mistake :

"Error: SMTP Error: Data not accepted."

Yesterday was working well, today started giving this error.

Yesterday the marketing people used to send mass message, I’m thinking it might be the server that exceeded the capacity.

$mail = new PHPMailer();
          $mail->IsSMTP();
          $mail->SMTPSecure = "tls";
          $mail->SMTPAuth   = true; 
          $mail->Host       = "smtp.office365.com"; // SMTP server
          $mail->Port       = "587";
          $mail->From       = "meu@email";//remetente
          $mail->Username   = "meu@email";
          $mail->Password   = "minhaSEnha";
          $mail->FromName   = "Empresa | Administração";
          $mail->AddReplyTo("meu@email");
          $mail->AddAddress($variavelcomemailcliente);
          $mail->Subject = "titulo da menssagem";
          $mail->IsHTML(true);

      $mail->AddAddress($variavelcomemailcliente);

      if($emailcliente!=$variavelcomemailcliente){
        $mail->AddBCC($emailcliente);
      }

      //
      $mail->AddBCC("meu@email", "Empresa");

      $mail->Body = $html;

          if(!$mail->Send())
         {
            echo "Mensagem não foi enviada!";
            echo "Erro: " .$mail->ErrorInfo;
        }

1 answer

3


Friend, this can occur for several reasons. As you yourself mentioned bulk sending is usually blocked due to spam among others.

I advise you to add this line of code in your script $mail->SMTPDebug = 1; For thus you will have a complete and exact return of what is occurring and not only this: "Error: SMTP Error: Data not accepted."

here $mail->SMTPDebug = 1; in addition to int 1, you can use the Downloads too, which will always help you debug errors:

$mail->SMTPDebug = SMTP::DEBUG_SERVER;
$mail->SMTPDebug = 2; //Alternative to above constant

SMTP::DEBUG_OFF (0): Disable debugging (you can also leave this out completely, 0 is the default).
SMTP::DEBUG_CLIENT (1): Output messages sent by the client.
SMTP::DEBUG_SERVER (2): as 1, plus responses received from the server (this is the most useful setting).
SMTP::DEBUG_CONNECTION (3): as 2, plus more information about the initial connection - this level can help diagnose STARTTLS failures.
SMTP::DEBUG_LOWLEVEL (4): as 3, plus even lower-level information, very verbose, don't use for debugging SMTP, only low-level problems.
  • 2

    Thank you very much my friend, your tip was very helpful, it returned me this error now ERROR: The data is not accepted by the server: xxxxxxx full mailbox; now know that the problem should be the storage, I only have a doubt, the storage and on my Server, where the system is hosted, or and the email inbox we use in the case here Officer 365.

  • 2

    @Jardelaraujo good afternoon, look I believe it is office 365, but it can also be your server. I believe that you can solve. Because now you have filtered the problem. See which email you are sending via smtp, mark this account as unlimited. Then check your server for any storage locks. I hope I helped. Hug

Browser other questions tagged

You are not signed in. Login or sign up in order to post.