views:

23

answers:

1

Hi. i'm using php 5.3 apache 2.2 and phpmailer library to send mails using smtp and the process is ok.

the problem is that send a email using smtp require some time to occurs and while this happen, the apache doesn't process any other request.

how can i fix it?

A: 

I assume you mean that the instance handling the email request takes a long time to complete - rather than it blocking all instances of the weberver? The latter should never happen unless there is a shared mutex across all the PHP code (and even then it will only affect requests to PHP pages - not to static content).

Can you give an indication of how long its actually taking?

MTAs (mail transport agents) are all about queueing mails, and highly optimized to do so - So Frank Farmer's suggestion is a very bad one.

It'd be helpful if you gave us a clue about the OS and where the MTA is.

IME, long delays can be caused by bad DNS lookups - are you using ip addresses in your mail config or ip names? Have you got a smart relay configured for the local MTA (getting this wrong usually means that mail will get sent but only after quite a long pause).

Have you checked your MTA logs?

C.

symcbean
actually, it's taking between 5 and 15 seconds to send a mail while it connect to the smtp server, send the data... MTA?... i don't know... i'm newer in phpthe server is a linux shared hosting
Danilo
MTA statnds for mail transport agent - its the daemon which does all the mail routing / queueing. If your on a shared hosting platform then you won't be able to debug the fault nor can you fix it. Complain to your provider.
symcbean