PHP Mail() scripts do not work with configured external SMTP server. This can be verified in Tools & Settings > External SMTP Server
The following error appears in
Apr 20 20:19:27 host msmtp: host=smtp.gmail.com tls=on auth=on [email protected] [email protected] [email protected] errormsg='the server sent an empty reply' exitcode=EX_PROTOCOL
Port misconfiguration for the external SMTP server configured in Plesk.
Go to Tools & Settings > External SMTP Server and configure a valid port according to the external SMTP server requirements
How to configure Postfix to send emails using SendGrid