In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article is to share with you about the solution to the failure of email delivery in php. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
The solution to the failure of php email sending: 1, configure the appropriate SMTP server address and port information in php.ini; 2, send mail with the help of sendmail program.
This article operating environment: linux5.9.8 system, PHP7.1 version, Dell G3 computer
What if I fail to send php email?
PHP send email error
Warning: mail () [function.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
Solution:
The Mail function of PHP uses the E-Mail issued by the SMTP service. In other words, you need to configure the appropriate SMTP server address and port information in php.ini. If you need to issue E-Mail on your local computer, that is
SMTP = localhostsmtp_port = 25
In that case, you need to configure the SMTP service on your own local machine. You can try to open IIS's SMTP service.
To be clear, the mail () function in php uses the sendmail program to send mail, and sendmail-t-I is generally the linux/unix system's own program, but the windows system does not have this program, so you can not directly use the mail () function to send mail.
Realize sending email by using mail () under windows
1. The sending mail system must have SMTP service. Install the SMTP Service component under "windows Server 2003":
A, "add and remove Windows components"-> "Application Server"-> "Internet Information Services (IIS)" click "details".
B. Select "SMTP Service" to install.
2. Set SMTP:
A. Open the Internet Information Services (IIS) Manager and find the default SMTP virtual server.
Right-click on the service and select Properties.
C. Click the "access" table item in the pop-up "default SMTP Virtual Server Properties" box, and select the "Authentication" button.
D. in the pop-up "Authentication" box, select only "Anonymous access" and nothing else.
E, go back to the "access" table item, select the "Relay" button, click the "add" button in the pop-up "Relay restriction" box, and add the IP address of 127.0.0.1.
3. Modify "php.ini":
-
[mail function]; For Win32 only.SMTP = localhostsmtp_port = 25; For Win32 only.sendmail_from = me@example.com
-
4. Run this program and log in to the mailbox shown in "$toaddress" to view the email.
$toaddress = 'xuzhang@mascatv.com';$subjects =' test the php mail';$mailcontent = 'Onlu test the php mailbox' from address = 'From: me@localhost.com';mail ($toaddress,$subjects,$mailcontent,$fromaddress); thank you for reading! This is the end of this article on "the solution to the failure of sending email in php". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.