Home > Article > CMS Tutorial > What to do if phpcms email fails to be sent
What should I do if phpcms email fails to be sent?
The reason why phpcms email fails to be sent:
1: The best is to use the corporate email, (I don’t know why it fails when using the ordinary one)
2: If the local test succeeds but the test on the server fails, it may be that the server configuration disables the fsockopen function.
Use phpinfo to check whether the disable_functions item has fsockopen. If so, it means this is the problem.
Solution:
Open: phpcms\modules\member\classes\client.class.php,
Put the 78th line: if( !$fp = fsockopen($mail['server'], $mail['port'], $errno, $errstr, 30)) {
Change to: if(!$fp = pfsockopen($ mail['server'], $mail['port'], $errno, $errstr, 30)) {
That is, change fsockopen to pfsockopen.
PS: Some hosting providers disable the fsockopen function to prevent hackers from using fsockopen to conduct PHPDDOS attacks after exploiting program vulnerability injection.
The difference between the fsockopen function and the pfsockopen function is that pfsockopen remains keep-alive, making it impossible for hackers to carry out connection number attacks.
PHP Chinese website, a large number of free PHPCMS tutorials, welcome to learn online!
The above is the detailed content of What to do if phpcms email fails to be sent. For more information, please follow other related articles on the PHP Chinese website!