First step: Need to download Phpmailer package phpmailer-1.73.tar.gz from the Open source community: http://phpmailer.sourceforge.net/
Step two: Confirm that your server system already supports sockets such as, through Phpinfo (); see if support sockets
If this is not the case, note that the socket is part of the PHP extension and must be given a configuration option for./configure--enable-sockets at compil
First step: Need to download Phpmailer package phpmailer-1.73.tar.gz from the Open source community: http://phpmailer.sourceforge.net/
Step two: Confirm that your server system already supports sockets such as, through Phpinfo (); see if support sockets
If this is not the case, note that the socket is part of the PHP extension and must be given a configuration option for./configure--enable-sockets at compil
Phpmailer class calls the remote SMTP server to send mail implementation method, mailersmtp. Phpmailer class calls the remote SMTP server to send mail implementation method. mailersmtp this article describes the phpmailer Class Call remote
Copy codeThe Code is as follows: Require_once ('../class. phpmailer. php ');
$ Mail = new PHPMailer ();
$ Body = "I finally sent the email! Haha! Goodboy! // Use SMTP to send emails
$ Mail-> IsSMTP ();
// Email server
$ Mail-> Host = "smtp.mail.yahoo.com.cn ";
$ Mail-> SMTPDebug = 0;
// Use SMPT for verification
$ Mail-> SMTPAuth = true;
//
Sample as below:Require_once ('.. /class.phpmailer.php ');//include ("class.smtp.php"); Optional, gets called from within class.phpmailer.php if not already loaded$mail = new Phpmailer (); $body = file_get_contents (' contents.html '); $body = Eregi_replace ("[\]" "," ', $body); $mail->issmtp (); Telling the class to use Smtp$mail->host = "mail.yourdomain.com";
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
Error_reporting (E_all);Error_reporting (e_strict);Date_default_timezone_set (' America/toronto ');Date_default_timezone_set (Date_default_timezone_get ());Include_once ('.. /class.phpmailer.php ');Include ("class.smtp.php"); Optional, gets called from within class.phpmailer.php if not already loaded$mail =new Phpmailer ();$body = $mail->getfile (' contents.html ');$body =eregi_replace ("[\]" ",", $body);$mail->issmtp (); Telling the class to use
Phpmailer is a PHP function package used to send emails through SMTP.
Its functions include:
* Specify multiple recipients, CC addresses, hidden addresses, and reply addresses when sending mail.* Multiple email codes are supported, including 8bit, base64, binary, and quoted-printable.*. Supports SMTP Authentication.*. Support for redundant
Yahoo Mail's anti-virus and spam capabilities are well recognized. However, Yahoo Mail does not support POP3 and SMTP sending and receiving functions, the following describes how to enable Yahoo Mail to support POP3 and SMTP sending and receiving:Since "
This article mainly introduces the phpmailer class call method for sending mails from a remote SMTP server, and analyzes the phpmailer Class Call and mail sending techniques in combination with the instance form, for more information about how to use the php mailer class to call a remote SMTP server to send emails, see
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
Switch
$this->smtp_conn = Pfsockopen ($host,//The host of the server
2:
Files: class.phpmailer.php
291 lines:
Public Function issmtp () {$
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 () failed." (server environment Apache+php+mysql);Error Analysis: I use
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
[Solution] if the server is set to inaccessible to the Internet, can I use phpmailer's SMTP mail? If the server is set to inaccessible to the Internet, can I use phpmailer's SMTP mail? If the Message nbsp; cocould nbsp; not nbsp; be nb [solution] is set to inaccessible to the Internet, can I use phpmailer for 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 host of the server
Changed:
$ This-> smtp_conn = pfsockopen ($ host, // the host of the server
2:
File: class. phpm
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 host of the server
Changed:
$ This-> smtp_conn = pfsockopen ($ host, // the host of the server
2:
File: class. phpm
[Solve] The server is set to a non-accessible extranet can you use Phpmailer SMTP to send mail?
If the server is set to an unreachable extranet, can I use Phpmailer smtp to send mail?
Long time is set to always prompt for message could not being sent. Mailer error:smtp Connect () failed.
It suddenly occurred to me that
Phpmailer is a PHP function package that is used to send e-mail messages. Features include: Specify multiple recipients, CC address, send address and reply address, support for multiple message encodings including: 8bit,base64,binary and quoted-printable, support for SMTP authentication, Supports mail with attachments and HTML-formatted messages.Implementation code:PHPinclude' Class.smtp.php ';include' Clas
If the server is set to an unreachable extranet, can I use Phpmailer smtp to send mail?
Long time is set to always prompt for message could not being sent. Mailer error:smtp Connect () failed.
It suddenly occurred to me that my server was set to be inaccessible outside the network, can only be accessed by the extranet user form, this will cause the Phpmailer func
Recently, a project needs to be sent by email. Phpmailer is used to send the email successfully, but a problem occurs when you set the display name (diplayname. The exchange2010smtp server is used to send emails. When I change to 163sina and other emails for sending, the set display name can be normally fed back, but it will not be changed to exchange. What is the reason for this? 1 is to use another account to send emails. The alias is ThomasTest! [I
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.