0

I am using msmtp for sending emails from my sites, so i have set variable sendmail_path to /usr/bin/msmtp in php config file.

It works, but... I found a significant time difference between sending emails using php function mail() and sending from terminal, although it is one program.

It takes about a second when sending from terminal directly, and 5-10 seconds from php.

I have tested it a lot of times. It is always much longer.

Can anybody say why it is so, and what can I do to stop my sites hangs when it sends email.

HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
Alex B
  • 23
  • 4
  • I don't know where the timing difference comes from, but using a queue is usually the way to go with emails. You then have a different process getting mails from the queue and sending them, which allows to avoid halting. – Jerska Jul 03 '15 at 06:05
  • 5s delay may indicate unresponsive DNS server in `/etc/resolv.conf`. – AnFi Jul 03 '15 at 10:01

0 Answers0