Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/12/2010, 12:10
carvarr
 
Fecha de Ingreso: diciembre-2010
Ubicación: caucasia
Mensajes: 17
Antigüedad: 13 años, 4 meses
Puntos: 0
Pregunta problema con phpmailer

hola chicos, estoy tratando de hacer un script para enviar un correo electronico a una cuenta, pero obtengo el siguiente error: Message body empty, no se como solucionarlo . a ver si me pueden ayudar, gracias.

aca les dejo el codigo:

<?php
if(isset($_POST["nombre"])){
require_once ('../lib/mailer/class.phpmailer.php');
require_once ('../lib/mailer/class.smtp.php');
$correo = new PHPMailer();


$correo-> Mailer = "smtp";
$correo-> Host = "smtp.hotmail.com";
$correo-> Helo = "www.hotmail.com";
$correo-> SMTPAuth = true;
$correo-> Username = "[email protected]";
$correo-> Password = "*********";


$correo-> From = "[email protected]";
$correo-> FromName = "carlos mario";
$correo-> Timeout = 30;
$correo-> IsHTML(false);


$correo-> AddAddress($_POST["correo"], $_POST["nombre"]);
$correo-> Subject = $_POST["asunto"];
$correo-> body = $_POST["mensaje"];


if(!$correo-> AddEmbeddedImage($_FILES["imagen"],"tmp_name",'12345','imagen')){
echo "fallo añadir fichero";
}

$exito = $correo-> Send();

if(!$exito){
$correo-> ClearAddresses();
echo "correo no fue enviado";
}else{
echo "correo fue enviado exitosamente";
}
}
?>
<!DOCTYPE unspecified PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
<form action="correo.php" method="post" enctype="multipart/form-data" name="form1">
<table width="50%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="28%">Nombre:</td>
<td width="72%"><input name="nombre" type="text" id="nombre"></td>
</tr>
<tr>
<td>Correo:</td>
<td><input name="correo" type="text" id="correo"></td>
</tr>
<tr>
<td>Asunto:</td>
<td><input name="asunto" type="text" id="asunto"></td>
</tr>
<tr>
<td>Mensaje:</td>
<td><textarea rows="5" name="mensaje" id="mensaje"></textarea></td>
</tr>
<tr>
<td>Selecciona la imagen</td>
<td><input name="imagen" type="file" id="imagen"></td>
</tr>
</table>
<p>
<input type="submit" name="submit" value="Enviar">
</p>
</form>
</body>
</html>