teraz przy wysyłce osobnej do 10 adresatow osiagam czas wykonania skryptu 6-7 sekund...
a na serwerze jest limit 30 sekund i po tym czasie wywala error 500 :/
Czy ktos moze podpowiedziec co zrobic by skrypt wykonywal sie szybciej?
Z gory dziekuje!
<? include "mysql_db.php"; $baza = new MyDb; require_once('class.phpmailer.php'); //pobieranie adresow maili z poprzedniego formularza for($i=0;$i<=$size;$i++) { } require_once('class.phpmailer.php'); $mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch $mail->Host = ".."; // SMTP server $mail->SMTPDebug = 2; // enables SMTP debug information (for testing) $mail->SMTPAuth = true; // enable SMTP authentication $mail->Host = ".."; // sets SMTP server $mail->Port = 587; $mail->Username = "..."; // username $mail->Password = ">."; // password for($i=0;$i<=$size;$i++) { try { $mail->AddReplyTo('...', 'test'); $mail->SetFrom('mailing@...', 'test'); $mail->Subject = $_POST["temat"]; $mail->AddAttachment('ll.jpg'); // attachment $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically $tresc="<body style=\"margin: 10px;\"><div style=\"width: 640px; font-family: Arial, Helvetica, sans-serif; font-size: 11px;\">".$tresc2." <Br /><Br />"; $mail->MsgHTML($tresc); $adres = $_POST["adres"][$i]; $mail->AddAddress($adres); if(!$mail->Send()) { //echo "Mailer Error (" . str_replace("@", "@", . $_POST["adres"][$i] . ') ' . $mail->ErrorInfo . '<br />'; } else { echo "Message sent to :" . $_POST["adres"][$i] . ' (' . str_replace("@", "@", $row["email"]) . ')<br />'; } } catch (phpmailerException $e) { } catch (Exception $e) { } $mail->ClearAddresses(); } $mail->SmtpClose(); ?>