LNMP WordPress can not use the mail () function to send mail

Source: Internet
Author: User

First look at the WordPress hint:

Here, directly, the root cause of this problem is the failure to install or start the SendMail component.

The next thing is OK, we install the SendMail component directly.

Reinstall the SendMail component, I use the CentOS and install the following command:

Yum Install SendMail

The following illustration will appear:

Press Y-Health directly, after successfully installed the following figure:

It's not over yet, because we also need to configure the SendMail component. Fill in the SendMail absolute path.

Locate the following file directly:/usr/local/php/etc/php.ini

Then find the following in the file:

; Sendmail_path =

Modify it to:

Sendmail_path =/usr/sbin/sendmail-t-I.

Next, we start SendMail: The command is as follows:

/etc/init.d/sendmail start (Start SendMail)

In addition, there are several related commands:

/etc/init.d/sendmail Stop (Close sendmail)

/etc/init.d/sendmail Restart (reboot sendmail)

Next, we detect if SendMail is working:

/etc/init.d/sendmail status

Normal operation, will display running, the following figure:

function is implemented, but with the above test code test, found that a successful e-mail message is very slow, modified/etc/hosts, unmodified

127.0.0.1 localhost.localdomain localhost

Modified into

127.0.0.1 localhost.localdomain localhost host name

The command to view the host name of this computer is: hostname

Restart SendMail after completing the modification

Service SendMail Restart

To this, the SendMail component configuration was successful.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.