Reutilizo tu post porque tengo elmismo problema y NO consigo encontrar el fallo.
Código PHP:
<?php
require("class.phpmailer.php");
if ($_POST['action'] == "send") {
$varname = $_FILES['cv']['name'];
$vartemp = $_FILES['cv']['tmp_name'];
$mail = new PHPMailer();
$mail->Host = "localhost";
$mail->From = $_POST['correo'];
$mail -> FromName = $_POST['nombre'];
$mail->Subject = "Envio de CV desde PagWeb";
$mail->AddAddress("***@gmail.com");
if ($varname != "")
{
$mail->AddAttachment($vartemp, $varname);
}
$cuerpo .= "<div style=background-color:black;color:white;font-size:14px;top:0px;left:0px;position:absolute;>";
$cuerpo .= "<strong><h2>Formulario enviado</h2></strong>";
$cuerpo .="<table width=100% border=0>";
$cuerpo .= "<tr><td width=3%></td><td width=20%><strong>Nombre:</strong></td><td>" . $HTTP_POST_VARS["nombre"] . "</td></tr><tr><td></td></tr>";
$cuerpo .= "<tr><td width=3%></td><td><strong>Apellidos:</strong></td><td> " . $HTTP_POST_VARS["apellidos"] . "</td></tr><tr><td></td></tr>";
$cuerpo .= "<tr><td width=3%></td><td><strong>Email:</strong></td><td> " . $HTTP_POST_VARS["correo"] . "</td></tr><tr><td></td></tr>";
$cuerpo .= "<tr><td width=3%></td><td><strong>Telefono:</strong></td><td> " . $HTTP_POST_VARS["tlf"] . "</td></tr><tr><td><br/></td></tr>";
$cuerpo .= "<tr><td width=3%></td><td><strong>Comentario:</strong></td><td></td></tr><tr><td width=3%></td><td></td><td> " . $HTTP_POST_VARS["comment"] . "</td></tr>";
$cuerpo .= "</td></tr></table></font><br/><br/><br/></div></body></html>";
$mail->Body = $cuerpo;
$mail->IsHTML(true);
$mail->IsSMTP();
$mail->Host = 'ssl://smtp.gmail.com';
$mail->Port = 465;
$mail->SMTPAuth = true;
$mail->Username = '****@gmail.com';
$mail->Password = '123456789p';
$mail->Send();
}
?>
<html>
<head>
<title>ITM Cantabria</title>
<link REL="stylesheet" TYPE="text/css" HREF="../estilos.css">
</head>
<body>
<div id="general">
<div id="banner">
<img src="../images/banner.jpg" style="width:800px; height:120px;" />
</div>
<div id="menusuperior">
<ul id="horizontal">
<li><a href="index.php">Inicio</a></li>
<span style="color: #ffff00;">|</span>
<li><a href="empresa/index.php">La Empresa</a></li>
<span style="color: #ffff00;">|</span>
<li><a href="telecomunicaciones/index.php">Telecomunicaciones</a></li>
<span style="color: #ffff00;">|</span>
<li><a href="seguridad/index.php">Seguridad</a></li>
<span style="color: #ffff00;">|</span>
<li><a href="#">Central de Alarmas</a></li>
<span style="color: #ffff00;">|</span>
<li><a href="#">Empleo</a></li>
<span style="color: #ffff00;">|</span>
<li><a href="privado/index.php">Área Privada</a></li>
</ul>
</div>
<div id="menulateral">
<ul id="vertical">
<li style="list-style:none;"><span style="font-weight:bolder;font-size:12px;font-style:"><a href="index.php">Inicio:</a></span></li>
<hr /><br />
<li><a href="empresa/index.php">La Empresa</a></li>
<hr /><br />
<li><a href="telecomunicaciones/index.php">Telecomunicaciones</a></li>
<hr /><br />
<li><a href="seguridad/index.php">Seguridad</a></li>
<hr /><br />
<li><a href="#">Central Receptora de Alarmas</a></li>
<hr /><br />
<li><a href="#">Empleo</a></li>
<hr /><br />
<li><a href="privado/index.php">Área Privada</a></li>
<hr /><br />
</ul>
</div>
<div id="cuerpo">
<div id="titulo">
Empleo:<br />
<hr />
</div>
<div id="contenido">
<table width="100%">
<?
if( !$mail->Send() ) <---[B]********ERROR AQUI********[/B]
{
echo "'Error: ' . $mail->ErrorInfo";
}
else {
?>
<tr>
<td>Gracias, su curriculum ha sido enviado.</td>
</tr>
</table>
<? } ?>
</div>
</div>
<div id="pie">
<?php
$ano = DATE('Y');
?>
<center>- <a href="#">Inicio</a> - <a href="#">La Empresa</a> - <a href="#" >Telecomunicaciones</a> - <a href="#" >Seguridad</a> - <a href="#" >Central Receptora</span></a> - <a href="#" >Empleo</a> - <a href="#" >Área Privada</a> -</center><br />
<center><font size="-2"> © <?php echo $ano; ?> Instalación y Mantenimiento de Telecomunicaciones</font></center>
</div>
</div>
</div>
</body>
</html>
el class.phpmailer.php, el class.pop3.php y el class.smtp.php estan en la misma carpeta y me da el siguiente error:
Cita: Fatal error: Call to a member function Send() on a non-object in /var/www/pagina2/empleo/enviar.php on line 94