command line에서 email 작성
2013.06.03 13:21
http://askubuntu.com/questions/12917/how-to-send-mail-from-the-command-line
ssmtp 설치/설정
Install ssmtp :
sudo apt-get install ssmtp
Edit the ssmtp config file :
gksu gedit /etc/ssmtp/ssmtp.conf
Enter this in the file:
root=username@gmail.com
mailhub=smtp.gmail.com:465
rewriteDomain=gmail.com
AuthUser=username
AuthPass=password
FromLineOverride=YES
UseTLS=YESEnter the email address of the person who will receive your email:
ssmtp recepient_name@gmail.com
Now enter this:
To: recipient_name@gmail.com
From: username@gmail.com
Subject: Sent from a terminal!
Your content goes here. Lorem ipsum dolor sit amet, consectetur adipisicing.To send the email: Ctrl + D
첨부파일 포함 메일 보내기
mail name@mailserver.com -s "Attached file" <<EOF
Hi
~| uuencode $HOME/filename.txt filename.txt
EOF