Question

We are using PHP Mailer class to send email from our website. It is taking around 17 seconds for sending the email everytime. Apart from email sending remaining page loading and executing are normal.

Environment: SuSE Linux 11, Apache 2.4.1 and PHP 5.5 versions.

When sending email with PHP mail function it is fast and sending within 20 milliseconds but we want to use Mailer as it is SMTP based and spam free. Checked all the Apache, PHP and System logs for errors. Domain name was giving error and so we modified the hostname to a valid domain in main.cf file of postfix but of no use.

Not sure whether we are missing any SMTP or postfix configurations.

Checked all the related questions but did not get suitable suggestion. Any suggestion is greatly appreciated. Thanks in Advance!

Was it helpful?

Solution

The outgoing SMTP server that you are using with phpmailer may be tarpitting you. To test, from the host where php is running, try opening a telnet connection to the SMTP server on port 25. It should respond with a HELO or EHLO command immediately. Does it, or is there a delay?

After it responds, proceed the SMTP session as per the instructions at http://www.port25.com/how-to-check-an-smtp-connection-with-a-manual-telnet-session-2/. If there is a delay after any command, this is known as 'tarpitting'. Tarpitting is used by some mail servers to catch other mail servers that may be spamming (i.e. sending commands before they should) or to slow down mail servers that try too many messages in too short of a time.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top