error en Mailer Error: Message body empty
Publicado por aldo (1058 intervenciones) el 16/01/2016 21:21:37
Estoy creando un codigo para enviar mensaje con PHPMailer
pero arroja este mensaje:
Mailer Error: Message body empty
La verdad el Body contiene informacion, es extraño.
si alguien pudiera ayudarme por favor a ver cual es la falla.
Este es el codigo:
pero arroja este mensaje:
Mailer Error: Message body empty
La verdad el Body contiene informacion, es extraño.
si alguien pudiera ayudarme por favor a ver cual es la falla.
Este es el codigo:
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
<?php
//PHPMailer Object
error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE);
require("PHPMailer-master/class.phpmailer.php");
require("PHPMailer-master/class.smtp.php");
$mail = new PHPMailer;
$mail->IsSMTP();
# Definimos el formato del correo con UTF-8
$mail->CharSet="UTF-8";
$mail->SMTPDebug = 1;
# autenticación contra nuestro servidor smtp
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "tls";
$mail->Host = "smtp.live.com"; // sets MAIL as the SMTP server
$mail->Port = 587;
//From email address and name
$mail->From = "alecuello84@hotmail.com";
$mail->FromName = "Alejo";
//To address and name
$mail->addAddress("alecuello84@hotmail.com", "Recepient Name");
$mail->addAddress("alecuello84@hotmail.com"); //Recipient name is optional
//Address to which recipient will reply
$mail->addReplyTo("alecuello84@hotmail.com", "Reply");
//CC and BCC
$mail->addCC("alecuello84@hotmail.com");
$mail->addBCC("alecuello84@hotmail.com");
//Send HTML or Plain Text email
$mail->isHTML(true);
$mail->Subject = "Subject Text";
$mail->Body = "Mail body in HTML";
$mail->IsHTML(true);
$mail->MsgHTML($passw);
if(!$mail->send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "Message has been sent successfully";
}
?>
Valora esta pregunta


0