command line에서 email 작성

2013.06.03 13:21

Shadow 조회 수:27674

http://askubuntu.com/questions/12917/how-to-send-mail-from-the-command-line



ssmtp 설치/설정

  • Install ssmtp Install ssmtpsudo 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=YES

  • Enter 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 emailCtrl + D




첨부파일 포함 메일 보내기


mail name@mailserver.com -s "Attached file" <<EOF                 
Hi

~| uuencode $HOME/filename.txt filename.txt

EOF






사용자 로그인