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.