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 Phpmailer on a virtual host. Here are two ways to fix this:
This error indicates that the virtual host
Before doing a project to do a phpmailer to send mail with the function of "CI framework combined with phpmailer send mail", yesterday step on the line (just start with Sina cloud, too expensive, replaced by Ali), the test, send an email unexpectedly error ....
I wipe, not on-line time good, the second success, just started I thought is the SMTP address problem
Yahoo Mail does not activate pop by default. However, after activating pop, you can use your outlook and Foxmail to directly send and receive emails, which is convenient and quick. You can use the following methods to enable pop receiving and SMTP sending functions in Yahoo Mail.
1. Go to http://www.yahoo.com and log on to Y
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 host cocould not instantiate mail functionAfter half a day, it turns out that
Copy Code code as follows:
Require_once ('.. /class.phpmailer.php ');
$mail = new Phpmailer ();
$body = "I finally sent the mail successfully!" Oh! goodboy! Send mail with SMTP
$mail->issmtp ();
Mail server
$mail->host = "smtp.mail.yahoo.com.cn";
$mail->smtpdebug = 0;
Using SMPT validation
$mail->smtpauth = true;
User name for SMTP authentication
$
Parse instances sent by phpmailer for yahoo Mail. Copy the code as follows :? Phprequire_once (... class. phpmailer. php); $ mailnewPHPMailer (); $ body I finally sent the email! Haha! Goodboy! Branews. qq. coma
The code is as follows:
Require_once ('../class. phpmailer. php ');$ Mail = new
This article describes the use of Phpmailer to send Yahoo Mail examples, have the need for friends, refer to the next bar.Examples of e-mail phpmailer:
ISSMTP ();//mail server $mail->host = "smtp.mail.yahoo.com.cn"; $mail->smtpdebug = 0;//Use smpt authentication $mail-> Smtpauth = true;//smtp Authenticated us
Phpmailer is an excellent php email sending plug-in. it can be used to send messages in almost any email address. next I will introduce the sending method of 163 mailbox 126 mailbox yahoo mailbox. preparation: we must register an email (163 Email 1... phpmailer is an excellent php email sending plug-in. it can be used to send messages in almost any email address.
Copy CodeThe code is as follows:
Require_once ('.. /class.phpmailer.php ');
$mail = new Phpmailer ();
$body = "I finally sent the mail successfully!" Oh! goodboy!
Http://news.qq.com/a/20111115/000792.htm?qq=0ADUIN=594873950ADSESSION=1321316731ADTAG=CLIENT. qq.3493_.0 ";
Send mail with SMTP
$mail->issmtp ();
Mail server
$mail->host = "smtp.mail.yahoo.com.cn";
$mail->smtpdebug = 0;
Using SMPT Authentication
This article provides a detailed analysis of the instances sent by phpmailer for yahoo Mail. For more information, see
The code is as follows:
Require_once ('../class. phpmailer. php ');$ Mail = new PHPMailer ();$ Body = "I finally sent the email! Haha! Goodboy!Http://news.qq.com/a/20111115/000792.htm? Qq = 0 ADUI
This article provides a detailed analysis of the instances sent by phpmailer for yahoo Mail. For more information, see
The Code is as follows:
Require_once ('../class. phpmailer. php ');$ Mail = new PHPMailer ();$ Body = "I finally sent the email! Haha! Goodboy!Http://news.qq.com/a/20111115/000792.htm? Qq = 0 ADUI
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.
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
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
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
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: The c
The first is to open the pop of Yahoo Chinese mail according to the methods circulating on the network.There are two methods:Method 1:First, log on to your Yahoo mailbox. Note that if you are *** @ yahoo.com.cn, you will be charged for enabling pop in Yahoo Mail abroad, and there is no other way to use it. Choose "Mailbox option"> "account information" in sequenc
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:
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.