Please select To the mobile version | Continue to access the desktop computer version
| |

ศูนย์จัดการความรู้ สพป.ลย.๑

 Forgot password?
View: 39|Reply: 0

sendmail script from CentOS

[Copy link]
Post time: 2017-1-17 16:57:18
| Show all posts |Read mode
server ติดตั้ง CentOS แล้วทำไม่โปรแกรมที่ติดตั้งไม่ส่ง e-mail ให้สมาชิก


Installing sendmail
Sendmail should be listed in the /sbin/sendmail location. If the operating system you are using does not have sendmail installed then issue the following command: yum install sendmail
Allowing the web server to send email
SELinux within CentOS blocks the web server from sending email by default. To check the status on your CentOS computer issue the following command in the terminal: sestatus -b | grep sendmail (ปกติ CentOS ติดตั้ง sendmail ไว้อยู่แล้วไม่ต้อง yum install ก็ได้)
If the httpd_can_send value is turned on, then the SELinux will allow the server to send email via the web service. If it is not on, then you can change it by issuing the following command in the terminal: setsebool -P httpd_can_sendmail=on
Testing your server
To test your server to see if the web service can send out emails you can enter into the php interactive shell and issue the mail command. To enter into the php interactive shell enter the following command: php -a
Once in the php interactive mode enter the following command into you terminal, changing the email address in red to the destination email:
mail ('', "Testing Mail Server", "This is a test email from CentOS web server", null, "");
To exit from the php interactive mode enter the following command exit
ศูนย์เทคโนโลยีสารสนเทศเพื่อการศึกษา (Information Technology for Education Center : itec)
สำนักงานเขตพื้นที่การศึกษาประถมศึกษาเลย เขต ๑ (Loei Primary Educational Service Area Office 1)

Use magic Report

You have to log in before you can reply Login | ลงทะเบียน

Points Rules

ประวัติการแบน|ติดต่อเรา|ศูนย์จัดการความรู้ สพป.ลย.๑  

2017-3-30 18:04 GMT+7 , Processed in 0.080538 sec., 16 queries .

Powered by Discuz! X3.2

Release 20141225, © 2001-2017 Comsenz Inc.

MultiLingual version, Rev. 441, © 2009-2017

Quick Reply To Top Return to the list