i am using php 5.3 apache 2.2 and phpmailer library to transmit mails using smtp and the operation is ok.
however , send a email using smtp require a while to happens even though this happen, the apache does not process every other request.
how do i repair it?
I suppose you imply that the instance handling the e-mail request requires a very long time to accomplish - instead of it obstructing all cases of the weberver? The second should never happen unless of course there's a shared mutex across all of the PHP code (as well as it will only affect demands to PHP pages - to not static content).
Are you able to give a sign of methods lengthy its really taking?
MTAs (mail transport agents) are all about queueing mails, and highly enhanced to do this - So Frank Farmer's suggestion is an extremely bad one.
It would be useful were you to give us an idea concerning the OS and in which the MTA is.
IME, lengthy delays could be triggered by bad DNS searches - are you currently using ip addresses inside your mail config or ip names? Will you have a wise relay set up for that local MTA (getting this wrong results in that mail can get sent only after a significant lengthy pause).
Perhaps you have checked your MTA logs?