<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> </head> <form action="" method="POST"> <centeR> <input type="text" name="tytul" value=""><br><br><br> <textarea name="tresc" cols="50" rows="30"> </textarea><br> <input type="submit" value="Slij"></center> </form> <? include ("phpm/class.phpmailer.php"); include ("cfg.php"); { $i=0; $mailek = new phpmailer(); //foreach($file as $dane) foreach($file as $line_num => $line) { $mailek->From = $mailadm; $mailek->FromName = $nazwaser; $mailek->Subject = $_POST['tytul']; $mailek->SMTPAuth = true; $mailek->Host = $smtphost; $mailek->Port = $port; $mailek->AddAddress($line[$i], "Wiadomość"); $mailek->Username = $smtplogin; $mailek->Password = $smtphaslo; $mailek->CharSet = "UTF-8"; $mailek->Body = $_POST['tresc']; $mailek->IsHTML(true); $ver = $mailek->Send(); $i++; } } ?>
Dostaję z print_r:
Array ( [0] =>xx@xx.pl [1] => xx2.o2.pl ) <-- czyli poprawnie odczytany plik..
Nawet dostaję poprawą wartość $i (Czyli pętla miała tyle przebiegów ile adresów w pliku.)
Problem pojawia się gdy chce żeby przy każdym nast. obiegu pętli podawać mu inny adres.. Ten sposób co podałem nie działa.
Prosze o pomoc
