|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-02-23 16:41 UTC] sniper@php.net
[2004-03-08 07:11 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 09:00:01 2025 UTC |
Description: ------------ While sending emails with the mail() function in a loop, php stops immediately (crashes ??). Unfortuately, this happens not every time, only some times. There is no message in the log files, it just stops. Reproduce code: --------------- <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <body> <?php $db_connection = mysql_pconnect("localhost","wwwrun","abc"); mysql_select_db("cdzirkel",$db_connection); $offer_text="CD's (http://cd.cdzirkel.de)\n \n deaf dumb blind\n clawfinger\n \n live aus R?delheim\n R?delheim Hartreim Projekt\n \n 4 gewinnt\n Die fantastischen Vier\n \n soundtrack\n blade 2\n \n Betty\n Helmet\n \n ready an' willing\n whitesnake\n \n use your brain\n clawfinger\n \n wie Mutter und Tochter\n Badesalz\n \n Under the pink\n Tori Amos\n \n dark side of the moon\n Pink Floyd\n \n Talk On Corners\n The Corrs\n \n Nowhere...fast\n Fury in the slaughterhouse\n \n Jahmekya\n Ziggy Marley\n \n smash\n offspring\n \n Greatest hits\n Whitesnake\n \n Das ist nicht die ganze Wahrheit\n Die ?rzte\n \n Herzeleid\n Rammstein\n \n digimortal\n fear factory\n \n in concert with the London symphony orchestra\n deep purple\n \n time to move\n h-blockx\n \n america's least wanted\n ugly kid joe\n \n without you I'm nothing\n placebo\n \n Maxi's (http://maxi.cdzirkel.de) \n \n DVD's (http://dvd.cdzirkel.de) \n \n daredevil\n \n \n blade2 ungek?rzt\n \n \n blade\n \n \n the cell (mit J.Lo)\n \n \n matrix 1\n \n \n im Bann des Psychopathen\n \n \n B?cher (http://buch.cdzirkel.de) \n \n Werner - Oder Was?\n Br?sel\n \n"; $uqid = mysqlquery("SELECT * FROM user"); while( $ures = mysql_fetch_array($uqid) ) { $iid = $ures[id]; $email = $ures[email]; $name = $ures[name]; $familyname = $ures[familyname]; mail($email, "Neue Angebote bei CdZirkel", "Hallo $name $familyname ! \n\nBrandneu: Hier sind die neuesten Angebote bei CdZirkel.de. \n\n$offer_text \n\nDein CdZirkel Team \n\nHier kannst Du diesen Service abbestellen:\n http://cdzirkel.de/index.php?Update=1&iid=$iid \n(Oder in Deinen Einstellungen unter Profil)","From: admin@CdZirkel.de"); echo "$email <br>"; } echo "DONE"; ?> </body> </html> Expected result: ---------------- Should send an email to each user in db-table user and print a line with the email address on the result http-page. The code requires a mysqldatabase cdzirkel (passw. abc) that holds a table with all users: CREATE TABLE user ( id int(1) unsigned NOT NULL auto_increment, email varchar(100) NOT NULL default '', password varchar(100) default '', name varchar(100) default '', familyname varchar(100) default '', PRIMARY KEY (id) ) TYPE=MyISAM; Currently there are roughly 300 users in the database. Actual result: -------------- It stops (sometimes) in between. I also checked the return code of the mail function. Whenever it returned the code was o.k. So i think it hangs or it crashes.