PHP mailler hata

5 Cevap php

Ben aşağıdaki gibi php mailler ama hataları kullanmaya çalıştı.

SMTP -> FROM SERVER:
SMTP -> FROM SERVER:
SMTP -> ERROR: EHLO not accepted from server:
SMTP -> FROM SERVER:
SMTP -> ERROR: HELO not accepted from server:
SMTP -> ERROR: AUTH not accepted from server:
SMTP -> NOTICE: EOF caught while checking if connectedSMTP Error: Could not authenticate. Message could not be sent.

Mailer Error: SMTP Error: Could not authenticate. 

ve benim kod

 <?php
        require("class.phpmailer.php")
        $mail = new PHPMailer();        
        $mail->IsSMTP();                                    
        $mail->Host = "smtp.gmail.com";  
        $mail->Port = 465;        
        $mail->SMTPAuth = true;     

        $mail->SMTPDebug = 2;  
        $mail->Username = "admin@xxxxxxxxxxxx.in";  
        $mail->Password = "xxxxxxxx";   
        $mail->From = "admin@xxxxxxxxxxxx.in";
        $mail->FromName = "Mailer";
        $mail->AddAddress("xxxx@yahoo.co.in", "mine");               
        $mail->WordWrap = 50;                                 
        $mail->IsHTML(true);                                  

        $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";


        if(!$mail->Send())  {
           echo "Message could not be sent. <p>";
           echo "Mailer Error: " . $mail->ErrorInfo;
           exit;
        }
        echo "Message has been sent";

        ?>

5 Cevap

(Özellikle hosting) Bazı sunucular SMTP, SSL kullanarak sizi bloke edecektir, ben bir kez aynı sorunu vardı.

Eğer varsayılan PHP mail () fonksiyonu kullanarak deneyin veya SSL örneğin gerektirmeyen başka bir posta sunucusu üzerinden göndermek eğer ana değiştirmek ya noktası 25 değil 465.

Gibi bir şey AuthSMTP alternatif bir posta sunucusu için en iyi bahis olacaktır.

Ben SSL nedeniyle yanlış bağlantı noktasına bu başlamıştı.

SSL = 465 TLS = 587

See: http://mail.google.com/support/bin/answer.py?hl=en&answer=13287

ama emin $ mail-> Host = "smtp.gmail.com" => $ mail-> Host = "smtp.google.com" çalışmayın

Çünkü yangın duvarının olabilir?

If you can't sign in to Google Talk, or you're receiving an error that says, Could not authenticate to server, check if you have personal firewall software installed, or if your computer is behind a proxy server that requires a username and password.

http://www.google.com/support/talk/bin/answer.py?hl=en&answer=30998

Ben birkaç müşteri için aynı komut dosyası kullanmak ve (örneğin Openshift gibi) Amazon EC2 bulut sağlayıcılar dağıtırken sadece bu sorunun içine çalıştırın.

These are tried and tested settings in phpmailer: $mail->SMTPSecure = "tls"; // sets the prefix to the servier $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server $mail->Port = 587;

'Ama', onlar giden iletileri kabul etmiyoruz yapabileceğiniz çok fazla bir şey, bir 'anti-spam "/ politik manevra ve yerel olarak ve en barındırma sağlayıcıları çalışır çünkü bu beni yakaladı gibi Google blokları bu hizmetleri var bilgisayarlarınızın DNS / IP. Bunu kabul edin ve üzerinden iletileri yönlendirmek için başka bir SMTP sunucusu bakarak hareket.