PHP Mail () Function return error 500 Internal server

I have no idea why this is happening ... I am getting 500 internal server errors every time I try to run this PHP code. This is the only line of code (it was larger, narrowed down to this for testing).

The error logs didn't help. Unfortunately. I have read other threads posted about this - none of them helped.

Code ONLY:

 <?php
 mail("myemail@example.com", "Test!", "Hello, there!");
 ?>

      

+3


source to share


1 answer


You need to look into the php error log. Submit your journals here if you cannot determine which journals are relevant. Most likely, smtp settings depend. mail opens a socket connection. using smtp settings.

SMTP settings can be managed via ini or via:

ini_set('SMTP', 'smtphost'); 
ini_set('smtp_port', 25); 

      



The above settings are for example your own smtp settings. For example, if you have a Gmail account, you can use that to send mail. It depends on the specific situation that the smtp server you can use.

Here is the Gmail SMTP Settings . Also check out the documentation

+1


source







All Articles