
Fatal error: Call to undefined method PHPMailer::SetFrom()
Publicado por Juan (5 intervenciones) el 14/07/2017 02:18:46
HOLA ME PUEDEN AYUDAR?
NECESITO ENVIAR EMAIL DE NOTIFICACION A CORREOS DE USUARIOS DE MI BASE DE DATOS...
HE UTILIZADO ESTE METODO....
Y ME MANDA EL SIGUIENTE ERROR
Fatal error: Call to undefined method PHPMailer::SetFrom()
NECESITO ENVIAR EMAIL DE NOTIFICACION A CORREOS DE USUARIOS DE MI BASE DE DATOS...
HE UTILIZADO ESTE METODO....
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
<?php
require 'class.phpmailer.php'; //coloca la ruta donde tengas la clase phpmailer
require'class.smtp.php';
$mail = new PHPMailer();
$mail->IsSMTP(true); //Definir que vamos a usar SMTP
$mail->SMTPDebug = 2; //Esto es para activar el modo depuración. En entorno de pruebas lo mejor es 2, en producción siempre 0
$mail->Host = 'smtp.gmail.com'; //definimos gmail como servidor
$mail->Port = 587; //El puerto será el 587 ya que usamos encriptación TLS
$mail->SMTPSecure = 'ssl'; //Definimos la seguridad como TLS
$mail->SMTPAuth = true; //Tenemos que usar gmail autenticados, así que esto a TRUE
$mail->Username = 'impresiones.fcam@gmail.com';
$mail->Password = 'michelalexis';
$mail->SetFrom('impresiones.fcam@gmail.com', 'tu nombre (este es opcional)');
$mail->AddAddress("jc7michel_@hotmail.com"); //hotmail, yahoo, etc.
$mail->IsHTML(true); //Con esto le decimos que enviaremos el mensaje con formato html.
$mail->Subject = 'prueba.'; //asunto del mensaje
//variable que almacena el mensaje en formato html
$cuerpo = '<html>
</head>
<title>Mensaje</title>
</head>
<body>
<p>a qui tu mensaje!!!</p>
</body>
</html>';
$mail->Body = $cuerpo; //pasamos la variable donde guardamos el menasje
$mail->Send(); //enviamos el mensaje
?>
Y ME MANDA EL SIGUIENTE ERROR
Fatal error: Call to undefined method PHPMailer::SetFrom()
Valora esta pregunta


0