Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/11/2009, 18:27
EduardoCh
 
Fecha de Ingreso: mayo-2009
Mensajes: 43
Antigüedad: 15 años, 10 meses
Puntos: 2
¿porque no funciona?:'(:adios:

Tengo este codigo y por mas que lo intento no consigo que funcione...a ver si se os ocurre algo a vosotros.
---------------------------------------------------

<?php
$texto = $_POST['texto'];
$edu = $_POST['edu'];
if ($_POST['asignatura']=="") {
$asunto="[RICHMOND] ".$_POST["asunto"];
}
else {
$asunto="[RICHMOND]".$_POST["asignatura"]." - ".$_POST["asunto"];
}
$sender = $_POST['sender'];
$informacion = $_POST['informacion'];
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp-alum.uca.es"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->IsHTML(true);
$mail->Username = "******"; // GMAIL username
$mail->Password = "*****"; // GMAIL password
$mail->From = $_POST['sender'];
$mail->FromName = $_POST['nombre'];
$mail->Sender = $_POST['sender'];
$mail->Subject = $asunto;
$mail->Body = "<table border='0' cellpadding='0' bordercolor='black' style='border-collapse: collapse'>
<tr>
<td height='51' width='16' bgcolor='black' style='border-left-style: solid; border-left-width: 1px; border-right-style: none; border-right-width: medium; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px' rowspan='2'>&nbsp;</td>
<td bgcolor='red' style='border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1px; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px'>
<p align='center'><b><span style='background-color: 'red'>
<font size='2' color='black'>- RICHMOND MAIL -</font></span></b></p></td>
</tr>
<tr>
<td bgcolor='red' style='border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1px; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px'>
<p align='center'>
<span style='font-weight: 700; background-color: 'red'>
<font size='2' color='black'>COMUNICACIONES PROFESORADO - E.U.A. RELACIONES LABORALES,
TRABAJO SOCIAL Y TURISMO</font></span></p></td>
</tr>
<tr>
<td height='16' width='16' style='border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium'>&nbsp;</td>
<td height='9' width='763' style='border-left-style: none; border-left-width: medium; border-bottom-style: solid; border-bottom-width: 1px'>
</td>
</tr>
<tr>
<td height='16' width='16' bgcolor='red' style='border-left-style: solid; border-left-width: 1px; border-right-style: none; border-right-width: medium; border-top-style: solid; border-top-width: 1px; border-bottom-style: none; border-bottom-width: medium'>&nbsp;</td>
<td height='16' width='763' bgcolor='red' style='border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: solid; border-top-width: 1px'>&nbsp;</td>
</tr>
<tr>
<td height='16' width='16' bgcolor='red' style='border-left-style: solid; border-left-width: 1px; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium'>&nbsp;</td>
<td height='343' width='763' style='border-left-style: none; border-left-width: medium' valign='top'>
<font color='blue'>$texto</font></td>
</tr>
</table>";
$mail->WordWrap = 500;
$path = $_FILES['archivo']['tmp_name'];
$nombre = $_FILES['archivo']['name'];
$tipo_archivo = $_FILES['archivo']['type'];
$tamano_archivo = $_FILES['archivo']['size'];
$mail->AddAttachment($path,$nombre,"base64",$tipo_archiv o);
$path2 = $_FILES['archivo2']['tmp_name'];
$nombre2 = $_FILES['archivo2']['name'];
$tipo_archivo2 = $_FILES['archivo2']['type'];
$tamano_archivo = $_FILES['archivo2']['size'];
$mail->AddAttachment($path2,$nombre2,"base64",$tipo_arch ivo2);
if ($_POST['trabajo1']=="ON") {
$archivo1TS = file("1TS.txt");
$lineas = count($archivo1TS);
for($i=0; $i < $lineas; $i++)
{
$correos[] = $archivo1TS[$i];
}
}
if ($_POST['trabajo2']=="ON") {
$archivo2TS = file("2TS.txt");
$lineas = count($archivo2TS);
for($i=0; $i < $lineas; $i++)
{
$correos[] = $archivo2TS[$i];
}
}
if ($_POST['trabajo3']=="ON") {
$archivo3TS = file("3TS.txt");
$lineas = count($archivo3TS);
for($i=0; $i < $lineas; $i++)
{
$correos[] = $archivo3TS[$i];
}
}
if ($_POST['trabajotarde1']=="ON") {
$archivo1TST = file("1TST.txt");
$lineas = count($archivo1TST);
for($i=0; $i < $lineas; $i++)
{
$correos[] = $archivo1TST[$i];
}
}
if ($_POST['trabajotarde2']=="ON") {
$archivo2TST = file("2TST.txt");
$lineas = count($archivo2TST);
for($i=0; $i < $lineas; $i++)
{
$correos[] = $archivo2TST[$i];
}
}
if ($_POST['trabajotarde3']=="ON") {
$archivo3TST = file("3TST.txt");
$lineas = count($archivo3TST);
for($i=0; $i < $lineas; $i++)
{
$correos[] = $archivo3TST[$i];
}
}
if ($_POST['relaciones1']=="ON") {
$archivo1RL = file("1RL.txt");
$lineas = count($archivo1RL);
for($i=0; $i < $lineas; $i++)
{
$correos[] = $archivo1RL[$i];
}
}
if ($_POST['relaciones2']=="ON") {
$archivo2RL = file("2RL.txt");
$lineas = count($archivo2RL);
for($i=0; $i < $lineas; $i++)
{
$correos[] = $archivo2RL[$i];
}
}
if ($_POST['relaciones3']=="ON") {
$archivo3RL = file("3RL.txt");
$lineas = count($archivo3RL);
for($i=0; $i < $lineas; $i++)
{
$correos[] = $archivo3RL[$i];
}
}
if ($_POST['turismo3']=="ON") {
$archivo3TU = file("3TU.txt");
$lineas = count($archivo3TU);
for($i=0; $i < $lineas; $i++)
{
$correos[] = $archivo3TU[$i];
}
}
for($i=0; $i<=123; $i++)
{
$mail->ClearAllRecipients()
$mail->addBCC("$correos[$i]");
$mail->Send();
}
for($i=124; $i<=248; $i++)
{
$mail->ClearAllRecipients()
$mail->addBCC("$correos[$i]");
$mail->Send();
}
for($i=249; $i<=372; $i++)
{
$mail->ClearAllRecipients()
$mail->addBCC("$correos[$i]");
$mail->Send();
}
if(!$mail->Send()){
echo "Mailer Error: " . $mail->ErrorInfo;
}else{
echo "Su mensaje ha sido enviado...";
}
?>