Author Topic: send mail command in unix and bsd mutt  (Read 10624 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
send mail command in unix and bsd mutt
« on: มกราคม 23, 2011, 01:07:06 AM »
ปกติใช้ sendmail ก็ครอบคลุมหมดครับ แต่มา mutt แล้วก็เจ๋งดี สามารถ ส่งเป็น mutiple file ได้ครับ คือ
attach file หลายๆไฟล์

#echo "Subject: Welcome Message To NTT Members" | cat - /home/golf/sms_send.txt |
sendmail -F "support- mail@ntt.co.th"; -f support- mail@ntt.co.th $account <
$USERLIST/sms_send.txt

#pkg_add -r mutt

#mutt -s "Welcome Message To NTT Members" -a sms_send1.txt -a test.txt
unixwg@ntt.co.th < $USERLIST/sms_send.txt

-s คือ subject
-a คือ attachfile
< sms_send.txt คือ ข้อความที่จะให้แสดงใน message mail
unixwg@ntt.co.th คือ email ปลายทางที่จะส่งไป

ถ้าต้องการแก้ from ให้มาจากใครก็ set ที่

#vi /usr/local/etc/Muttrc
set from=" username@yourmail.com";


ถ้าต้องการ options เพิ่มก็ man mutt เลยครับ

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: send mail command in unix and bsd mutt
« Reply #1 on: เมษายน 12, 2011, 05:10:24 PM »
ถ้าเป็น 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 ปลายทางที่ต้องการส่งไปครับ

 ;)
« Last Edit: พฤษภาคม 16, 2013, 01:59:23 PM by golfreeze »

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: send mail command in unix and bsd mutt
« Reply #2 on: มิถุนายน 10, 2013, 01:40:19 PM »
อีก command ที่ผมชอบใช้ส่งเมล และ แนบรายละเอียดในไฟล์ มาแสดง เป็นเนื้อเมล คือ
#mailx  account@example.com <  attach_file_name

หรือ

#mail  account@example.com <  attach_file_name

ก็แล้วแต่ชอบครับ

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: send mail command in unix and bsd mutt
« Reply #3 on: กุมภาพันธ์ 27, 2015, 03:35:57 PM »
ใช้ mutt ส่งระบุ sender account "From: golftest@noc.ntt.co.th"
subject = -s "Hello kub"
to account = -c golftest@packet
message = < message
attach file = -a "PAYMENTCOPY.zip"

#mutt "From: golftest@packetlove" -s "Hello kub" -a "PAYMENTCOPY.zip" -c golftest@packet < message