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

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

 Forgot password?
 ลงทะเบียน
Search
View: 55|Reply: 5

sendmail script from CentOS

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

ข้อมูลจาก
https://lecturesnippets.com/lesson/sending-email-through-the-centos-7-php-web-server/

Sending Email through the CentOS 7 PHP Web Server
One of the tasks common to a web server include sending out emails from the web server. The CentOS 7 minimal installation should come with the software needed to send out emails. This software is called sendmail. To check to see if sendmail is installed on your server issue the termainal command: which sendmail
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
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
Viewing the email logs
You may want to check the mail log from time to time to see if you have any errors. The log file is located at /var/log/maillog. To view the last 10 entries in the log issue the following command: tail /var/log/maillog
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 ('user@to-email.com', "Testing Mail Server", "This is a test email from CentOS web server", null, "-fuser@from-email.com");
To exit from the php interactive mode enter the following command exit
If you do not see an email in your inbox, be sure to check the spam or junk folders.
http://itec.loei1.go.th
ศูนย์เทคโนโลยีสารสนเทศเพื่อการศึกษา (Information Technology for Education Center : itec)
http://www.loei1.go.th
สำนักงานเขตพื้นที่การศึกษาประถมศึกษาเลย เขต ๑ (Loei Primary Educational Service Area Office 1)
Reply

Use magic Report

Post time: 7 day(s) ago
| Show all posts
มาวันนี้ใช้ไม่ได้อีกแว้ว
Reply Support Not support

Use magic Report

Post time: 7 day(s) ago
| Show all posts
ยังไม่ผ่าน
Reply Support Not support

Use magic Report

 Author| Post time: The day before yesterday 12:56
| Show all posts
http://182.93.170.108/sendmail.php

มันก็ run ได้ปกติ แต่ทำไมไม่มีเมล์ไปถึงเราละหวา
http://itec.loei1.go.th
ศูนย์เทคโนโลยีสารสนเทศเพื่อการศึกษา (Information Technology for Education Center : itec)
http://www.loei1.go.th
สำนักงานเขตพื้นที่การศึกษาประถมศึกษาเลย เขต ๑ (Loei Primary Educational Service Area Office 1)
Reply Support Not support

Use magic Report

 Author| Post time: The day before yesterday 13:23
| Show all posts
สำหรับวันนี้ http://www.amplysoft.com/knowled ... r-linux-centos.html

http://itec.loei1.go.th
ศูนย์เทคโนโลยีสารสนเทศเพื่อการศึกษา (Information Technology for Education Center : itec)
http://www.loei1.go.th
สำนักงานเขตพื้นที่การศึกษาประถมศึกษาเลย เขต ๑ (Loei Primary Educational Service Area Office 1)
Reply Support Not support

Use magic Report

 Author| Post time: The day before yesterday 14:07
| Show all posts
# nano /etc/sysconfig/network
   NETWORKING=yes
   HOSTNAME=mydns157.dlinkddns.com

# nano /proc/sys/kernel/hostname
   HOSTNAME=mydns157.dlinkddns.com
http://itec.loei1.go.th
ศูนย์เทคโนโลยีสารสนเทศเพื่อการศึกษา (Information Technology for Education Center : itec)
http://www.loei1.go.th
สำนักงานเขตพื้นที่การศึกษาประถมศึกษาเลย เขต ๑ (Loei Primary Educational Service Area Office 1)
Reply Support Not support

Use magic Report

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

Points Rules

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

2017-4-28 21:07 GMT+7 , Processed in 0.084392 sec., 17 queries .

Powered by Discuz! X3.2

Release 20141225, © 2001-2017 Comsenz Inc.

MultiLingual version, Rev. 441, © 2009-2017 netdepviet.org

Quick Reply To Top Return to the list