Ver Mensaje Individual
  #3 (permalink)  
Antiguo 12/10/2007, 10:37
Avatar de MateoVasco
MateoVasco
 
Fecha de Ingreso: julio-2003
Mensajes: 132
Antigüedad: 20 años, 9 meses
Puntos: 0
Re: Uso repetitivo de phpmailer con bucle

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

<?php

$i=1;

$eco[1]="[email protected]";
$eco[2]="[email protected]";
$eco[3]="[email protected]";
$eco[4]="[email protected]";

require("class.phpmailer.php");

$mail = new PHPMailer();

$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "smtpmed.une.net.co"; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "[email protected]"; // SMTP username
$mail->Password = "danielaisa12"; // SMTP password

$mail->From = "[email protected]";
$mail->FromName = "Diego Ivan Correa - Economizadores.net";


while ($i<5)

{

$correo= $eco["$i"];

echo $correo."<br>";

$mail->WordWrap = 50; // set word wrap to 50 characters
$mail->IsHTML(true); // set email format to HTML

$mail->AddAddress("$correo");
$mail->Subject = "proof";
$mail->Body = "es para ver si <b>funciona</b> con html";
$mail->AltBody = "mierda";


if(!$mail->Send())
echo "There has been a mail error sending to " . $row["email"] . "<br>";

$i++;

$mail->ClearAddresses();

}

?>

</body>
</html>