Ver Mensaje Individual
  #9 (permalink)  
Antiguo 27/12/2011, 19:54
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: Función mail() no envía nada

phpmailer viene con una carpeta con varios ejemplos y metodos(mail(), smtp y sendmail, con y sin uso de SSL --> google,hotmail. etc)
este es el que usa mail() basico
<html>
<head>
<title>PHPMailer - Mail() basic test</title>
</head>
<body>

Código PHP:
Ver original
  1. <?php
  2.  
  3. require_once('../class.phpmailer.php');
  4.  
  5. $mail             = new PHPMailer(); // defaults to using php "mail()"
  6.  
  7. $body             = file_get_contents('contents.html');
  8. $body             = eregi_replace("[\]",'',$body);
  9.  
  10. $mail->AddReplyTo("[email protected]","First Last");
  11.  
  12. $mail->SetFrom('[email protected]', 'First Last');
  13.  
  14. $mail->AddReplyTo("[email protected]","First Last");
  15.  
  16. $address = "[email protected]";
  17. $mail->AddAddress($address, "John Doe");
  18.  
  19. $mail->Subject    = "testCron";
  20.  
  21. $mail->AltBody    = "Test Cron!"; // optional, comment out and test
  22.  
  23. $mail->MsgHTML($body);
  24.  
  25. $mail->AddAttachment("images/phpmailer.gif");      // attachment
  26. $mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
  27. //$mail->AddAttachment("/home/controldesalud.com/public_html/test/temporal/BeLight-0.22_RC1.zip"); // attachment
  28.  
  29. if(!$mail->Send()) {
  30.   echo "Mailer Error: " . $mail->ErrorInfo;
  31. } else {
  32.   echo "Message sent!";
  33. }
  34.  
  35. ?>
  36.  
  37. </body>
  38. </html>


@Adrii952. volviendo a tu script, en
if (mail($email, $asunto, $cuerpo, $headers)) {, donde tenes definido $email, que no lo veo?

SAludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.