Ver Mensaje Individual
  #14 (permalink)  
Antiguo 02/09/2005, 11:50
klyfa
 
Fecha de Ingreso: mayo-2005
Mensajes: 217
Antigüedad: 19 años
Puntos: 5
bueno aca te dejo un ejemplo que lo probe recien y me andubo perfectamente
<?php
require("phpmailer/class.phpmailer.php");
$mail = new PHPMailer();
$mail->Mailer="smtp";
$mail->Host = "localhost";
//$mail->SMTPAuth = true;
//$mail->Username = "[email protected] ";
//$mail->Password = "mipassword";
$mail->From = "[email protected]";
$mail->FromName = "formulario de mi web";
$mail->AddAddress("[email protected]");//destinatario
$mail->WordWrap = 80;
$mail->AddAttachment($_POST['file'], "new_name.zip"); // optional name
$mail->IsHTML(true);
$mail->Subject = "Envio de factura";
$mail->Body = "Hoa";
if(!$mail->Send())
{
echo "Error al enviar el mensaje. <p>";
echo "Error: " . $mail->ErrorInfo;
exit;
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Documento sin t&iacute;tulo</title>
</head>

<body>
<form name="form1" method="POST" action="">
<input type="file" name="file">
<input type="submit" name="Submit" value="Enviar">
</form>
</body>
</html>


yo utilese un servidor smtp local, asique si tu servidor smtp requiere autorizacion tendras que poner la siguiente lineas:
$mail->SMTPAuth = true;
$mail->Username = "[email protected] ";
$mail->Password = "mipassword";

y otra de las cosas que te tenes que fijar que es un error boludo pero a mi me sucedio, pense que no andaba y el correo me estaba entrando como correo no deseado. jejejje
ademas te dejo dos pag:

http://www.programacion.com/php/articulo/phpmailer/
esta te explica en castellano

http://phpmailer.sourceforge.net/extending.html
y aca te pongo la pagina oficial de phpmailer.