Page 1 of 1

mail with mail and sendmail

Posted: Wed Jan 29, 2003 3:32 am
by Heavy
I just installed sendmail on my 166 MHz Pentium Linux Mandrak 9.0 Server.
I put a mail sender in my loginscript for a site just for testing:

Code: Select all

for ($a=0 ; $a<10 ; $a++)&#123;
		 mail( "a@b.c" , "tofo".($a+1) , $_POST&#1111;'LoginUserName']." har loggat in \n och detta spam har skickats ".($a+1)." ggr.\n\nHihi!" );
		&#125;
Now... This works SLOOOOWLY when sending only one mail ( $a = 1 ). But when trying to send several emails, it just does not get finished sending. I mean The login procedure hangs.

Is this a normal behaviour of "mail()" ? I mean. The user would think there is a problem when the request starts chewing seconds...

Background:
The email is sent to a true email adress on the internet. This server is located in a LAN that is routed to the Internet through an IDSN box. This box hangs up after say 30 seconds, so maybe the sendmail procedure doesn't like that. However, even if I keep the connection alive by surfing the web and checking for email all the time it doesn't do the job fast.

Any considerations i missed??

Posted: Wed Jan 29, 2003 7:24 am
by DaZZleD
of what i know the mail() function lets the mail server deal with the mails. it just issues the command. however if the mail server doesn't take the command while the script timeout ends, the script dies and the mails are not sent. try setting the script timeout to a longer period.