'465', $mail->SMTPSecure = 'ssl'" ."/> '465', $mail->SMTPSecure = 'ssl'" .">
Home > Article > Backend Development > What to do if there is an error in the php mail server
What should I do if there is an error in the php mail server? PHP sending email fails on the server?
PHP sends emails, the code is correct, the local execution is OK, but when it is executed on the server, it fails?
Recommended video tutorial: "php tutorial"
Cause
● SMTP server is written incorrectly
● The SMTP server port is occupied
Solution
● Go to the official website of the outgoing mailbox to see the configuration
● Do not use port 21, use port 465 instead , while using security protocols.
That is:
’SMTP_PORT’ => ‘465’ , $mail->SMTPSecure = ‘ssl’
The above is the detailed content of What to do if there is an error in the php mail server. For more information, please follow other related articles on the PHP Chinese website!