Golfreeze.packetlove.com: Life style of Golfreeze Canon400D Family kammtan.com Jazz Freebsd Unix Linux System Admin guitar Music
All about unix linux freebsd and FAQ for Packetlove.com Web hosting , Mail hosting , VoIP + IP PBX server => command , shell script ,tool , crontab => Topic started by: golfreeze on มกราคม 24, 2011, 01:51:19 pm
-
ปกติใช้ sendmail ก็ครอบคลุมหมดครับ แต่มา mutt แล้วก็เจ๋งดี สามารถ ส่งเป็น mutiple file ได้ครับ คือ attach file หลายๆไฟล์
#echo "Subject: Welcome Message To NTT Members" | cat - /home/golf/sms_send.txt | sendmail -F "support-mail@xxxx.co.th" -f support-mail@xxxx.co.th $account < $USERLIST/sms_send.txt
#pkg_add -r muttjavascript:void(0);
#mutt -s "Welcome Message To xxx Members" -a sms_send1.txt -a test.txt unix@xxxx.co.th < $USERLIST/sms_send.txt
-s คือ subject
-a คือ attachfile
< sms_send.txt คือ ข้อความที่จะให้แสดงใน message mail
unixwg@xxxx.co.th คือ email ปลายทางที่จะส่งไป
ถ้าต้องการแก้ from ให้มาจากใครก็ set ที่
#vi /home/user/.muttrc
set from="username@yourmail.com"
set realname = username test"
ถ้าต้องการ options เพิ่มก็ man mutt เลยครับ
-
ถ้าเป็น command ง่ายก็นี่เลยครับผม
#mutt -a xxx.php -s "check send at 1706" golfreeze[at]packetlove[dot]com
โดยที่
1. xxx.php เป็นไฟล์ที่ attach ไปในเมลครับ
2. ส่วน "check send at 1706" คือ subject
3. golfreeze[at]packetlove[dot]com = email ปลายทางที่ต้องการส่งไปครับ
;)
-
อีก command ที่ผมชอบใช้ส่งเมล และ แนบรายละเอียดในไฟล์ มาแสดง เป็นเนื้อเมล คือ
#mailx account@example.com < attach_file_name
หรือ
#mail account@example.com < attach_file_name
ก็แล้วแต่ชอบครับ
-
# Send email inform admin
echo "Backup Mongod finish on ${FULLTIME}" | mail -s "Backup Mongod ${FULLTIME} done" abe@gmail.com