On the Net

|Main Blog|Yearning|  

Words of God


About Linux News and OpenSource

How to Install and Use Windows Applications on Linux using PlayOnLinux
Thursday, January 31, 2019

In this article, we will explain how to install PlayOnLinux on your Ubuntu both through the command line and the graphical user interface. More importantly, we will explain how to install a Windows application, Notepad Plus Plus in our example, by using PlayOnLinux. .. read more..

How To Add The BlackArch Pentesting Repository To Arch Linux
Thursday, January 31, 2019

BlackArch is a penetration testing distribution, similar to Kali Linux, but it’s built on top of Arch Linux. In reality, BlackArch is really a pre-configured Arch installation with an extra repository full of security tools. As a result, you can add the BlackArch repository to a regular install o... .. read more..

WINE 4.0, LXQt 0.14, Parrot OS, Mastodon, MythTV, Gitea, APT Vulnerability | ...
Thursday, January 31, 2019

also on TWinL52: Lubuntu Council Announced, Manjaro Stable Update Breakage, Multipass, gotop, TuxClocker, Dell's XPS 13 9380, Ad Blocker Breakage in Chrome Extension Manifest V3, Humble Bundles .. read more..

Free Drawing And Painting Program MyPaint 2.0.0 Alpha Released
Thursday, January 31, 2019

After being in development for more than 2 years, MyPaint 2.0.0 alpha is available for download. MyPaint is a free, open source drawing and painting program available for Windows, macOS, and Linux. The application features infinite canvas, configurable brushes, graphics tablet support, and a dist... .. read more..

Ubuntu 18.04 needs patching
Thursday, January 31, 2019

Canonical is updating Ubuntu 18.04 to the 4.15.0-44.47 Linux kernel to fix several security bugs. .. read more..




and below are my posts....


Thursday, February 16, 2006

Sending email from CLI on linux with attachment

Sending email from CLI on linux with attachment

Email clients to be used:


nail
email - http://email.cleancode.org/
mutt



These is a quick guide on how to send email via Linux CLI, with attachement and can be run as cron job.

On Mandriva:

Install nail


urpmi nail


Now, to send an email with attachment, the command will be


nail -s test -a file-to-be-attached.tar.gz user@email.com


where:
-s = subject
-a = attached file

or see manpage of nail for more commands man nail

After you hit the enter doing that command, it will wait for you to type a message and end with . (dot) so that it will execute and exit. It will not work when intended as cron jobs, so we have to change that command.. see below


echo "this is a little message" | nail -s test -a file-to-be-attached.tar.gz user@email.com


It will now send the email with attached file without prompting you to write a message.

Enabling to send email with attachment, we can write a little script and run it as cron job.

On Centos: ( I did not find a package "nail" on centos so the alternative, which also a good one is "email")

Download "email" from http://email.cleancode.org/?pid=download. Choose the right package for your distro, if RPM, download it then install:


rpm -ivh email.xxx.rp



then edit /etc/email.conf

send email with attched file with the command below


email -s "test" -b -f sendername -a file.tar.gz user@emailme.com


where:
-s = subject
-b = sending blank email
-f = sender's name
-a = attached file

Ohhh...! I realized that doing above with mutt is also possible, the command should be like below:


echo "this is a test" | mutt -a file-2-attach.tar.gz user-email@domain.tld -s my subject


Since mutt works, I dont need to install the mentioned package above.. email

0 Comments:

Post a Comment

<< Home