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 => Mail issue , problem , configuration => Topic started by: golfreeze on มกราคม 23, 2011, 01:07:06 am

Title: send mail command in unix and bsd mutt
Post by: golfreeze 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- [email protected]"; -f support- [email protected] $account <
$USERLIST/sms_send.txt

#pkg_add -r mutt

#mutt -s "Welcome Message To NTT Members" -a sms_send1.txt -a test.txt
[email protected] < $USERLIST/sms_send.txt

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

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

#vi /usr/local/etc/Muttrc
set from=" [email protected]";


ถ้าต้องการ options เพิ่มก็ man mutt เลยครับ
Title: Re: send mail command in unix and bsd mutt
Post by: golfreeze 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 ปลายทางที่ต้องการส่งไปครับ

 ;)
Title: Re: send mail command in unix and bsd mutt
Post by: golfreeze on มิถุนายน 10, 2013, 01:40:19 pm
อีก command ที่ผมชอบใช้ส่งเมล และ แนบรายละเอียดในไฟล์ มาแสดง เป็นเนื้อเมล คือ
#mailx  [email protected] <  attach_file_name

หรือ

#mail  [email protected] <  attach_file_name

ก็แล้วแต่ชอบครับ
Title: Re: send mail command in unix and bsd mutt
Post by: golfreeze on กุมภาพันธ์ 27, 2015, 03:35:57 pm
ใช้ mutt ส่งระบุ sender account "From: [email protected]"
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