(1) The server cannot send mail using SMTP
Workaround: Many sites listed the solution is because of the SMTP case, although the nature of the problem is not here, but do need to change this place, as for why, look at the following operation.
In class.phpmailer.php, you will:
function Issmtp () {$this->mailer= ' SMTP ';}
Change to:
function Issmtp () {$this->mailer = ' SMTP ';}
Instead of using SMTP to send mail, this place uses a different way to send mail, checking the class.phpmailer.php file for the following paragraph:
Switch ($this->mailer) {case ' SendMail ': Return $this->sendmailsend ($header, $body); case ' SMTP ':// Because SMTP and SMTP are not equal, the following mailsend is selected to send mail instead of sending mail using SMTP return $this->smtpsend ($header, $body);d Efault:return $this- >mailsend ($header, $body);}
(2) the Fsockopen () function is disabled for Linux hosts
There are many space service providers in China to disable the server's Fsockopen function for security reasons.
Workaround:
Use the Pfsockopen () function instead of fsockopen (), and if the Pfsockopen function is also disabled, you can replace the socket function with other operations, such as Stream_socket_client ().
Change @fsockopen into a @pfsockopen in class.smtp.php
Put
$this->smtp_conn = @fsockopen ($host, //The host of the server $port, //The port to use $errno, / /error number if any $errstr, //error message if any $tval); Give up after? secs
Change to:
$this->smtp_conn = @pfsockopen ($host, //The host of the server $port, //The port to use $errno,
//error number if any $errstr, //error message if any $tval); Give up after? secs
(3) Firewall security settings rules, if the above two scenarios are not effective, it is estimated that the firewall rules, you can let the server administrator remove all firewall rules, and then test to see if this is the reason.
Articles you may be interested in
- Fatal error call to undefined function date_default_timezone_set ()
- Fatal error Class ' soapclient ' not found in ... Error handling methods
- Fatal error Class ' ziparchive ' not found ... The solution
- PHP tip php warning:date (): It is not safe to rely on the ... The wrong solution
- PHP Tip maximum execution time of seconds exceeded ... The wrong solution
- Web cache control Cache-control common values are private, No-cache, Max-age, Must-revalidate Introduction
- How to troubleshoot PHP run with a call to undefined function Curl_init error
- PHP Output Control In-depth understanding of the difference between Ob_flush and flush
http://www.bkjia.com/PHPjc/764172.html www.bkjia.com true http://www.bkjia.com/PHPjc/764172.html techarticle (1) The server cannot send mail in the form of SMTP solution: Many websites list the solution is because of the SMTP case, although the nature of the problem is not here, but really ...