PHP用户无法通过Mutt发送电子邮件,但普通用户可以

I am experimenting with PHP and have run into a problem. I am trying to have my php script send an email when a process has completed.

<!DOCTYPE html>
<html>
<body>

<?php
echo shell_exec('echo "testing" | mutt -x -F /usr/web/mail.mut -s test -- my_email_here@gmail.com');
?>

<br>
Thanks. PDF copys of energy plots have been emailed.

</body>
</html>

The result is the echo displaying "Could not send message" on the page.

However, when I am logged into the host, I can issues the exact same command and the messages goes through.

Some supplementary info. The host is a Linux Mint vm. MTA is postfix. When logged into the host as my user (not the PHP user), mutt works perfectly from the terminal. I've checked file permissions on the mutt config file specified and it should be fine. The mutt config file (/usr/web/mail.mut) just has my account info for gmail. Again, when I execute the same command the messages comes through. I also tried looking in /var/log/syslog but there are not entries.

Grateful for any advice.

EDIT:

As per michal's comment. I've also tried the following with the same result.

echo shell_exec('mutt -F /usr/web/mail.mut -s testing -- myemailhere@gmail.com < message');

Did not solve the problem but found a better solution to what I was trying to do.

Ended up using PHPMailer with ssmtp (postfix would have worked but ssmtp is super easy to set up).