Results 1 to 2 of 2

Thread: Easiest way to email a file from the command line

  1. #1
    Join Date
    Sep 2005
    Location
    Dallas, Tx
    Beans
    266
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Easiest way to email a file from the command line

    I want to write a script which when ran tars up a directory and emails it to an email address, then promptly deletes the file to preserve space.

    I know how to do the rest but what's the best way to email a file from the command line?
    Desktop
    Antec 300 Illusion, Athlon II X4 640, 8GB DDR3 1333, EarthWatts430W, Radeon HD 6670 1GB
    Laptop
    Lenovo Thinkpad Z61T, T7200@2.00GHz, 2GB DDR2, 100gb HD, TPM Encryption

  2. #2
    Join Date
    Aug 2008
    Location
    Brazil
    Beans
    12,497
    Distro
    Ubuntu Studio 12.04 Precise Pangolin

    Re: Easiest way to email a file from the command line

    Use sendEmail.

    Install:

    Code:
    sudo apt-get install sendemail
    Usage:

    Code:
    sendEmail -f username@foo.com -t destination@foo.com -u "The Subject" -m "The message" -a /home/user/the_attachment.zip -s smtp.foo.com:25 -xu username -xp password

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •