If you decided to use Google as your mail server and already set up it in a way like:

  1. Set the SMTP server name to smtp.gmail.com
  2. Set the username to your google email address
  3. Enter your password
  4. Set SMTP Port to 465
  5. Set SMTP Encryption to TLS

 

yet when I tried to send email I was receiving “internal server error ” msgs.

In the error log I see “Premature header…”

After spending hours on research I found that on your server you should have outgoing port 465 not blocked by the firewall.