Want to know phpmailer could not connect to smtp host? we have a huge selection of phpmailer could not connect to smtp host information on alibabacloud.com
Phpmailer is a great open source messaging class, and it's very simple to use, but for a virtual host, there are always restrictions. Just now I encountered an "SMTP error:could not connect to SMTP host" error using
Cause analysisIf this problem occurs, the name of the SMTP host Solution: It depends on the email payment does not support sending and receiving mails by pop3. This can be viewed officially by email, such as QQ mail.Phpmailer error SMTP Error: cocould not connect to SMTP
PHP phpmailer sends an email and cannot connect to the host because the fsockopen function is disabled. phpmailer sends an email based on this function.
Modify:
Class. stmp. php
Solution:
1:
Row 3:
$ This-> smtp_conn = fsockopen ($ host, // the
Php PHPMailer sends an Email and cannot connect to the host because the fsockopen function is disabled. PHPmailer sends an Email based on this function.
Modify:
Class. stmp. php
Solution:
1:
Row 3:
$ This-> smtp_conn = fsockopen ($ host, // the
PHP Phpmailer Send the message, there is no connection to host, this is because the Fsockopen function is disabled, Phpmailer send email dependent on this function.
Modify:
class.stmp.php
Solve:
1:
118 lines:
$this->smtp_conn = Fsockopen ($host,//The host of the server
Swit
Using Phpmailer to send messages uses an unencrypted SMTP server, and the SMTP server used this time is connected using SSL (secure Sockets Layer, Secure Sockets Layer).
Fortunately, Phpmailer support SSL SMTP server, online data, thought that the lower mouth, plus smtpsecu
SMTP error:could not connect to SMTP host.
I use the Web page runtime Normal, can send, with the command to run PHP file times wrong, the main code is checked correctly, as follows
function SendMail ($setEmail, $setName, $body, $subject) {Require_once ("phpmail/phpmailer.php");$mail = new
Recent projects related to the ability to send mail, using Phpmailer in the local debugging good, one on the server on the error, prompted: "SMTP Connect () failed. ”。 On-line search, found a solution, and successfully resolved, record, for a rainy day.Error message: "SMTP Connect
(1) The server cannot send emails using smtp.
Solution: the solution listed by many websites is due to the smtp case sensitivity problem. Although the problem is not here in essence, it must be changed. For the reason, refer to the following operations.
In class. phpmailer. php, set:
function IsSMTP(){$this->Mailer='smtp
When PHPMailer sends an email, the host cannot be connected (CouldnotconnecttoSMTPhost ). PhpPHPMailer sends an Email and cannot connect to the host. this is because the fsockopen function is disabled. PHPmailer sends an Email based on this function. Modify: class. stmp. php
#---------------------------------------------------------------------- --------------
# Encryption key cannot be given
# The username and password are encrypted and decrypted tools are in the Desutil
#--------------------------------------- ---------------------------------------------
#登陆用户名 I wrote it casually,
mail.smtp.username=. cboch2llydmw2432vyrede4tjvjrstamcoe123111
#密码 QQ for authorization code 111111 I wrote it casually
mail.smtp.password= avq5jebimunr5f4wcllzza==
problems encounte
Phpmailer version used: 5.2.1
The following are some of the code given in the example folder of Phpmailer: test_gamil_basic.php.
The code is as follows
$mail = new Phpmailer (); $body = file_get_contents (' contents.html '); $body = $_post[' body ']; $body = Eregi_replace ("[]", ", $body); $mail-gt;issmtp (); Telling the class t
Step one: Need to download Phpmailer packages phpmailer-1.73.tar.gz from the open source community: http://phpmailer.sourceforge.net/
Step two: Confirm that your server system has supported the socket as shown below, through phpinfo (); see if support for sockets
If you do not have this item, please note that the socket is part of the PHP extension and must be given a configuration option for the./configure
thinkphp no mail send function, so, I think about, will phpmailer integration into thinkphp it. Phpmailer is not in line with the thinkphp specification plug-in program, so we need to first put Phpmailer program into thinkphp Library/vendor directory, I here is the latest version of Thinkphp 3.2, if it is thinkphp Before the 3.2 version, the Lib directory may be.
This content reproduced source: http://my.oschina.net/BearCatYN/blog/299192, and made a change.thinkphp no mail send function, so, I think about, will phpmailer integration into thinkphp it.Phpmailer is not in line with the thinkphp specification plug-in program, so we need to first put Phpmailer program into thinkphp Library/vendor directory, I here is the latest version of Thinkphp 3.2, if it is thinkphp
Phpmailer version used: 5.2.1The following are some of the code given in the example folder of Phpmailer: test_gamil_basic.php.
The code is as follows
Copy Code
$mail = new Phpmailer ();$body = file_get_contents (' contents.html '); $body = $_post[' body '];$body = Eregi_replace ("[]", ", $body);$mail->issmtp (); Telling the class to
Use smtp.163.com to send mail (local serverless) Step 1: Download phpmailerfile package phpmailer-1.73.tar.gz from open source community: http://phpmailer.sourceforge.net/
Step 2: Check whether your server system supports socket, for example, phpinfo ();
If you do not have this option, note that socket is an extension of PHP, and a configuration option for./configure -- enable-sockets must be given during c
Step 1: Download phpmailerfile package phpmailer-1.73.tar.gz from Open Source
Community : Http://phpmailer.sourceforge.net/
Step 2: Check whether your server system supports socket, for example, phpinfo ();
If you do not have this option, note that socket is an extension of PHP, and a configuration option for./configure -- enable-sockets must be given during compilation.
Step 3: extract the file to your web server directory and call the class. Note:
Today, when you use Phpmailer to send SMTP mail, you are prompted for an SMTP Error:could not authenticate error, where the password account is correct, and the mailbox is set to turn on SMTP.
Google Baidu over again, some say that the server has disabled the port, and some say that the class.phpmailer.php in the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.