Sending Mail from the CLI

Derek derekmailbox at gmail.com
Mon Feb 26 10:15:04 UTC 2007


As it has been said it depends if you have or have not sendmail installed
and running, just try the following:

#Compress and archive what you want to send:
tar -czf destfile.tar.gz /path/to/whateveryouwanttosend
#Send an email with the file attached
echo | mutt -s subjectoftheemail -a /path/to/destfile.tar.gz
recipient at domain.net

I execute these two lines in a file as cron script to send me daily a small
backup. Note I've to use "sudo" before each line due the permissions in the
files involved.

I hope it helps!


On 2/26/07, Amichai Rotman <amichai at iglu.org.il> wrote:
>
> Hi Folks!
>
> I am connected to my home from work using an SSH terminal.
>
> I would like to compress a file and send it to an e-mail address from the
> CLI.
>
> How do I do that? I know it's possible....
>
> Thanks!
>
> --
> .:====================================================:.
>
> Amichai Rotman
>
> UIN#: 6401746
> Registered Linux User#: 201192 [http://counter.li.org/ ]
>
>
> ------------------------------------------------------------------------------------------------------------
>
> PLEASE READ: http://www.gnu.org/philosophy/no-word-attachments.html
>
> .:====================================================:.
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20070226/5dce7af3/attachment.html>


More information about the ubuntu-users mailing list