
Problema con PHP Mailer
Publicado por Jonathan (3 intervenciones) el 05/12/2015 00:16:49
Buen día, al querer hacer uso del PHP Mailer me sale el siguiente error:
the following from address failed: [email protected] : called mail() without being connected
¿Tengo algo malo en mi código?
La verdad he estado buscando pero no encuentro nada de lo que pueda ser
the following from address failed: [email protected] : called mail() without being connected
¿Tengo algo malo en mi código?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
$mail_gmail='villarrealbli01@gmail.com';
$pass_gmail='************';
require 'php_mailer/class.phpmailer.php';
require 'php_mailer/class.smtp.php';
$mail_destino='lethal_blizzard_rap@gmail.com';
$datos = $_POST;
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = "tsl";
$mail->Host = "smtp.gmail.com";
//$mail->Host = "localhost";
$mail->Port = 567;
$mail->Username = $mail_gmail;
$mail->Password = $pass_gmail;
$mail->From = $mail_gmail;
$mail->FromName = "Contacto";
$mail->Subject = "Contacto desde el sitio web";
$mensaje = "Se ha recibido una nueva solicitud de contacto, los datos son los siguientes: <br/>";
$table = "<table border='1'>";
$table.= "<tr>";
$table.= "<td>Nombre</td>";
$table.= "<td>".$datos['nombre']."</td>";
$table.= "</tr>";
$table.= "<tr>";
$table.= "<td>E-mail</td>";
$table.= "<td>".$datos['email']."</td>";
$table.= "</tr>";
$table.= "<tr>";
$table.= "<td>Comentarios</td>";
$table.= "<td>".$datos['comentario']."</td>";
$table.= "</tr>";
$table.= "</table>";
$mail->Body = $mensaje."<p></p>".$table;
$mail->SMTPDebug = false;
$mail->IsHTML(true);
$mail->AddAddress($mail_destino);
$resultado = "";
if($mail->Send())
{
$resultado = array('estatus'=>true,'mensaje'=>'DATOS ENVIADOS EXITOSAMENTE');
}
else
{
$resultado = array('estatus'=>false,'mensaje'=>'ERROR '.$mail->ErrorInfo);
}
echo json_encode($resultado);
?>
La verdad he estado buscando pero no encuentro nada de lo que pueda ser
Valora esta pregunta


0