|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Script takes 1-2 minutes to send an email
I am using a simple script to send mail with php. The script works. I send an email to myself locally in Linux and I get it right. The problem is that the action of sending the email takes from 1 to 2 minutes which is unacceptable for the application. This has got to do with sendmail I think. I have seen a similar or maybe the same problem in this thread:
http://forums.devshed.com/showthrea...hlight=sendmail But there was no answer for the problem. If anyone has any idea, I'd love to read it. Thanks. Clairvo |
|
#2
|
||||
|
||||
|
The speed in which you receive email is dependent on a number of variables, none of which involve php. Are you using your own box or a hosting service? If you're using a hosting service, there's really nothing that you can do other than complain.
Assuming you're using your own box, you have to look at your routing scheme. How many domains are you using? Routers? Proxy servers? Finally, if you're sending internet mail, you're at the mercy of the internet (obviously). The bottom line is, you're asking a question that probably can't be answered in a forum like this. |
|
#3
|
|||
|
|||
|
OK, so I explained it all wrong....
I meant that the script "hangs" for 1-2 minutes, that is, it won't continue with the code under the mail() function, in this case a redirection using header(), until it is done with the mail, and that takes a lot for the application. To put it clear, I am not talking about the time that the mail takes to reach the recipient but the time the mail() function takes to send the mail with sendmail and continue with the rest of the script. Hope that I explained it better this time. Thanks. Clairvo |
|
#4
|
||||
|
||||
|
Is this your own server or is it one from a hosting provider. What it seems to be doing is waiting for sendmail to fully complete the mail sending. You need to switch sendmail into a queuing mode so that the message will get queued and then your script will work correctly
|
|
#5
|
|||
|
|||
|
OK, a.koepke, I think you set me in the right direction. The computer is connected to my university's network. I told them the problem but they couldn't solve it. I cannot change things myself as I don't have root access but I can tell them ideas so they can try.
We use there the default call 'sendmail -t -i' in php.ini as I saw in the manual page http://www.php.net/manual/en/ref.mail.php (in the user notes). I have been looking at a sendmail tutorial and it says that -i is for inmediate sending of mails and that this is very slow and not recommended. Instead, it says that the usual method is to use -b (of background) that makes sendmail generate a son to handle the mail. I think that might be the solution, I can' t test it now because I can't change php.ini myself. Anyway I will let you know how I go. Clairvo |
|
#6
|
||||
|
||||
|
Yes, that would be the right solution. Let me know how it goes
![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > Script takes 1-2 minutes to send an email |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|