A strange problem occurs in the number of letters sent by a PHP batch. That is:
Warning: mail (): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php. ini or use ini_set () in .......
Of course, this color is not displayed on the webpage, but for this reason, but you can set the color of the indicator, this will be worth your consideration.
After searching for related answers over the internet, including related technical blog posts, you can easily explain the solutions. most of the changes are just mentioned: php. the [mail function] function in ini is used to enable the smtp function. The following is a change to the smtp function:
[Mail function]
SMTP = localhost
Smtp_port = 25
Sendmail_from = youremailUsual@domin.com
In this case, it is necessary to explain that this component is From.
Sendmail_path = ""
It is empty at first, and it is explained in the background.
Mail_add_x_header = on
There is no need to change the mechanism of the on statement.
In this step, I have modified and re-installed apache. Of course, I actually operated this operation in CMD, I got a little smile. how stupid I am!
After the renewal is completed, refresh the renewal surface.
So far, stackoverflow mentioned IIS (windows-recognized server), which cannot be found in Control Panel-Administrative Tools, because it is a Windows 7 player, you can just open it under the add and remove programs. Pay attention to the operation and you can find it in the management tool, at this time, we can see that all smtp tokens are excited. when zookeeper is opened, the related data is configured, as shown in the screenshot below:
Correction: I forgot to issue a video here. Sorry! 7-5 minutes later.
To be honest, what we have done in this step is better than what we have done. The above is ASP.net's choice, which takes care of your PHP affair. [It is not successful anyway].
I tried to solve the problem by checking the smtp protocol in Baiji Baike. Click Here to submit a ticket.
In the future, modify [mail function] as follows:
Take the configuration in the 126 cases box as an Example
SMTP = smtp.126.com
Smtp_port = 25
Sendmail_from = my126EmailAddress@126.com
Sendmail_path = ""
Mail_add_x_header = on
At the same time, the value of $ from variation in the program is modified to be consistent.
[Because of the previous modification, add the phpinfo () function to the program. After reading the line, search for mail details in the program, you will find that there is a Localhost Value and master Value. Of course, this is a good understanding. Localhost Value refers to the number set in your program, and the master Value is php. settings of ini]
Then, the magic hacker disappears, but the following example appears:
Mail (): SMTP server response: 553 You are not authorized to send mail, authentication is required aaf353e4-8ac5-416e-9cd5-6b54fc592764
After that, I changed the other email boxes, such as QQ and Gamil, as shown in the above prompt. After reading a familiar word authorized, I realized what I meant.
In this step, it seems that success is not successful. I think of the time when I used the client terminal to configure a mailbox for use, in the last step, you will be asked if you need to open the "server Identity Authentication ". the last one accidentally found a file package called sendmail. The following is the download address: sendmail.
Later, it is best to create a new file named sendmail under the root directory of PHP, and then import the file into the folder and parse it, modify a file called sendmail. ini file, which is modified as follows:
; Take the fomus email provider in China 126 for example
[Sendmail]
Smtp_server = smtp.126.com
Smtp_port = 25
Default_domin = 126.com
Auth_username = strings in your email address before char '@'
Auth_password = your password which allow you to login in your email-box
Hostname = 126.com
Later, you have to modify php. ini, or the old place:
SMTP = smtp.126.com
The same is true for changing to localhost. Other options remain unchanged.
Smtp_port = 25
Sendmail_from = my126EmailAddress@126.com
Sendmail_path = "your sendmail path/sendemail.exe-t"
; Of course, the first half of this route must include the root category of your PHP server and convert "\" "/", I think it is necessary.
Mail_add_x_header = on
After the configuration is complete, refresh your apache, refresh the hosts, and the hosts disappear, because the $ to set in the program is your 126 and QQ hosts box, of course.
I know that I resolve it. the content of the opening component is exactly the same as the content I added to the component, and some content is also exported from the local data volume.
Author: Tian haoyu