visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
316 experts, 1194 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Languages :: PHP :: mail & php very slow - How can script ignore ?


By: mfuerlinger U.S.A.  Date: 25/09/2003 00:00:00  English  Points: 300 Status: Answered
Quality : Excellent
Here is my "nut":

I'm running a php script which sends mail on a linux pc. I'm testing the script within an fast intranet.
Everything works fine - except the fact it takes a pretty long time (5-60 sec.) to finish the mail cmd in my php-script.
My php scripts uses the system mail prog "mail" from Berkeley Distribution which I want to keep.

Tested already mailing directly with a mail-prog or mailing over console - all as same user and over same servers: everything was sent in less then 1 sec.

Is there a way to push the invoked mail process in the background or can I somehow ignore the waiting without changing my mail method completely ?

In my php-script I use the following to start the mail process:

mail($to, $subject, $mime, $headers);

pls tell if you need more info
mathias





By: mfuerlinger Date: 25/09/2003 03:39:00 English  Type : Comment
could be helpfull some Logging-Information:

using tail -f mail.log I recognize a delay of the log entry: "....Message accepted for delivery...." but only when the mail process is invoked by my php script. No error or abnormal messages around ...
By: VGR Date: 25/09/2003 07:02:00 English  Type : Answer
try direct SMTP protocoling
By: mfuerlinger Date: 26/09/2003 03:38:00 English  Type : Comment
? can you be a bit more precise please
By: ThG Date: 26/09/2003 10:16:00 English  Type : Comment

mail() is NOT the "system mail", which is by definition the executable file /usr/bin/mail

and mail() doesn't invoke /usr/bin/mail, but rather it invokes /usr/sbin/sendmail that, depending on your sendmail version, either triggers the spooling engine or tries directly to connect to the remote SMTP, thus making waiting time too long.

Unfortunately this is all i know about this topic, we may look for a solution together but unfortunately i haven't got much free time nowadays. I can tell you that, given you have sendmail 8.12.x, it must be related to the sender/receiver DNS resolving..


Do register to be able to answer

EContact
browser fav
page generated in 296.676870 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page