Home >Backend Development >PHP Problem >PHP mailbox sending failed

PHP mailbox sending failed

angryTom
angryTomOriginal
2019-10-16 17:29:283802browse

PHP mailbox sending failed

Use PHPMailer and SMTP to send emails. If an error occurs, you can troubleshoot from the following aspects.

1. Check the phpinfo() page to confirm that the sockets extension is enabled.

2. Confirm openssl is enabled.

3. Confirm allow_url_fopen is enabled.

4. Add custom logs to the code to facilitate troubleshooting when errors occur.

5. Check whether ports 25 and 465 (SMTPS) are occupied.

If you are using port 465, you can modify:

$mail->Port = 465;

to:

$mail->SMTPSecure = 'ssl';
$mail->Port = 465;

For more PHP related knowledge, please visit PHP Chinese website!

The above is the detailed content of PHP mailbox sending failed. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn