2016-10-16 3 views
-1

내 비밀번호를 재설정하기 위해 노력하고있어와 SMTP에 대해 오류가 발생하고 제대로 동작하지 않습니다PHPMailer

오류 :

SMTP Error: Could not authenticate. Error: SMTP Error: Could not authenticate.

내가 보내는 이메일에 대한 코드 아래 사용하고 있습니다 :

<?php 
    require_once ("PHPMailer_v5.1\class.phpmailer.php"); 
    $Correo = new PHPMailer(); 
    $Correo->IsSMTP(); 
    $Correo->SMTPAuth = true; 
    $Correo->SMTPSecure = "tls"; 
    $Correo->Host = "smtp.gmail.com"; 
    $Correo->Port = 587; 
    $Correo->Username = "[email protected]"; 
    $Correo->Password = "123456"; 
    $Correo->SetFrom('[email protected]','De Yo'); 
    $Correo->FromName = "From"; 
    $Correo->AddAddress("[email protected]"); 
    $Correo->Subject = "testing PHPMailer"; 
    $Correo->Body = "<H3>it works!</H3>"; 
    $Correo->IsHTML (true); 
    if (!$Correo->Send()) 
    { 
    echo "Error: $Correo->ErrorInfo"; 
    } 
    else 
    { 
    echo "Message Sent!"; 
    } 
?> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <title>Frank Parts C.A. - Módulo de Recuperación de Contraseña</title> 

<!-- bootstrap --> 
    <link rel="stylesheet" href="assests/bootstrap/css/bootstrap.min.css"> 
    <!-- bootstrap theme--> 
    <link rel="stylesheet" href="assests/bootstrap/css/bootstrap-theme.min.css"> 
    <!-- font awesome --> 
    <link rel="stylesheet" href="assests/font-awesome/css/font-awesome.min.css"> 

    <!-- custom css --> 
    <link rel="stylesheet" href="custom/css/custom.css"> 

    <!-- jquery --> 
    <script src="assests/jquery/jquery.min.js"></script> 
    <!-- jquery ui --> 
    <link rel="stylesheet" href="assests/jquery-ui/jquery-ui.min.css"> 
    <script src="assests/jquery-ui/jquery-ui.min.js"></script> 

    <!-- bootstrap js --> 
    <script src="assests/bootstrap/js/bootstrap.min.js"></script> 
</head> 
<body> 

<div class="container"> 
     <form class="form-signin" method="POST"> 

     <?php if(isset($smsg)){ ?><div class="alert alert-success" role="alert"> <?php echo $smsg; ?> </div><?php } ?> 
     <?php if(isset($fmsg)){ ?><div class="alert alert-danger" role="alert"> <?php echo $fmsg; ?> </div><?php } ?> 
     <h2 class="form-signin-heading">¿Olvidó su Contraseña?</h2> 
     <br> <br> 
     <div class="input-group"> 
     <span class="input-group-addon" id="basic-addon1">@</span> 
     <input type="text" name="username" class="form-control" placeholder="Nombre de Usuario" required> 
    </div> 
    <br><br><br> 
     <button class="btn btn-lg btn-primary btn-block" type="submit">Recuperar Contraseña</button> 
     <a class="btn btn-lg btn-primary btn-block" href="index.php">Iniciar Sesión</a> 
     </form> 
</div> 

</body> 
</html> 

PHP 메일러를 사용하고 있지만 다른 코드를 시도했지만 아무 것도 작동하지 않습니다.

아무도 도와 줄 수 있습니까?

+0

다른 포트로 시도하십시오. – itzmukeshy7

답변

0

암호에 특수 문자가 포함되어 있기 때문에 발생합니다. Password = "djgh \ dfgfjk"와 같은 특수 문자 앞에 "\"를 사용하려고했습니다. 그러나 그것은 나를 돕지 않았다. 나는 특수 문자없이 새로운 ID와 간단한 암호를 만들었고 놀랍게도 그 일은 놀랍습니다. 암호를 특수 문자와 함께 사용하십시오.

+0

암호가 간단하고 작동하지 않습니다. 나는 새로운 사용자와 간단한 암호로 시도했다 .. 같은 오류 – Alvaro