First Google a bit, found a lot of questions related to the question but no relevant solutions, in the phpclasses also did not find the relevant classes so they look at the stmp of the relevant agreement to begin to try Curl
SMTP protocol
This can be found on the internet a number of relevant examples, you can experiment with Telnet to connect mail server
PHP based on the socket implementation of SMTP send mail method, SOCKETSMTP
The example in this article describes how PHP sends mail based on the socket implementation of SMTP. Share to everyone for your reference. The specific analysis is as follows:
PHP uses a socket to send mai
On the Internet, email is the most popular transmission medium. This article consists of two agreements:. POP 3 Protocol: The POP3 Protocol (Postal Transport Protocol) refers to receiving letters from an email server. I have submitted a class that encapsulates the POP3 protocol. The official description of the agreement you can refer to RFC1225. SMTP protocol: SMTP
' # setting up the outgoing server address port=25# Set the outgoing server port number. Note that there are SSL and non-SSL two forms sender= ' XXXXXX@163.com ' # set up the email address, be sure to register your own mailbox pwd= ' XXXXXX ' # set the password of the email, etc will be used in receiver= ' XXXXXX
mail dispatcher using the socket
Summarize
Brief introduction
Mail delivery is often a lot. NET application, especially in the application with network function, one of the indispensable modules, this article introduces the use. NET SMTP class library and two other ways to send mail via CDO (collaboration Data Objects
Smtplib module:The SMTP (Simple Mail Transfer Protocol) is simply the message Transfer Protocol, which is a set of rules for sending mail from the source address to the destination, and it controls the way the letters are relayed.Python's Smtplib provides a convenient way to send e-mails. It provides a simple encapsulation of the
This article mainly introduced the PHP implementation to support SSL connection SMTP mail send class, the example analyzes the PHP implementation SMTP mail sends the class the principle and the technique, as well as the support SSL connection method, needs the friend to be possible to refer to under
-->
The example in
$ Telnet Mailbox SMTP Service address 25Trying mailbox Service IP address ...Connected to mailbox SMTP service address.Escape character is ' ^] '.Exchange Mailbox server address Microsoft ESMTP MAIL Service ready at Sat, 2 June 2012 15:02:12 +0800EHLO 127.0.0.1-exchange Mailbox ser
The SMTP (Simple Mail Transfer Protocol) is simply the message Transfer Protocol, which is a set of rules for sending mail from the source address to the destination, and it controls the way the letters are relayed.Python's Smtplib provides a convenient way to send e-mails. It provides a simple encapsulation of the SMTP
The SMTP (Simple Mail Transfer Protocol) is simply the message Transfer Protocol, which is a set of rules for sending mail from the source address to the destination, and it controls the way the letters are relayed. The SMTP protocol is a TCP/IP protocol cluster that helps each computer find its next destination when s
configuration parameters, the following lines of SMTP authentication are defined as follows:
Mynetworks: Used to control the network address or IP address that can be sent out via the server.
Smtpd_recipient_restrictions: Set the recipient address filtering rules, the matching policy is "from top to bottom" order, if there is a meeting policy, and immediately stop. A few common values are described below
Two ways to send mail, bloggers have personally tested the success of the 1.TP official website Method
(http://www.thinkphp.cn/extend/248.html)a). Introducing function Libraries: Email.class.php placed under the component folderb). configuration file: common/conf/config.php, add the following:
' Smtp_server ' => ' smtp.163.com ',// mail
Connection closed by foreign host.
On this basis, you can write a simple SMTP class.
Class stmp{
Private $mailcfg =array ();
Private $error _msg= ';
function __construct ($mailcfg) {
$this->mailcfg= $mailcfg;
}
Public function Send ($mail) {
$mailcfg = $this->mailcfg;
if (! $fp = Fsockopen ($mailcfg ['
encoding format is UTF-8, And the transfer encoding format is base64* @ Example* $ Mail = new MySendMail ();* $ Mail-> setServer ("smtp@126.com", "XXXXX@126.com", "XXXXX"); // sets the smtp server, common connection mode* $ Mail-
has just entered the ranks of the "development" has always had an idea when can I give me a huge database of user information to send recommendations to each user's mailbox?Just entered "programming two months" I use SMTP to send webmail, first on the common mail server on the code/********************************** here is the
is no need to close it here. After smtp command: After QUIT is sent, the server closes the connection and the local socket resources are automatically released.Echo 'mail OK! ';Return true;}/*** Error message returned* @ Return string*/Public function error (){If (! Isset ($ this-> _ errorMessage )){$ This-> _ errorMessage = "";}Return $ this-> _ errorMessage;}/
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--enable-sockets at compile time.
Step thre
---telnetclient. Tick on and then OK (some people's computers will also see "Telnet Server", be careful not to choose the wrong.) The server is for your computer to be logged in as the servers, and what we have to do now is to use our own computer as client landing Mailbox server.Try again in cmd, direct input Telnet smtp.163.com 25, the first line shows the welc
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.