Sending mail under linux console – mail commandWysyłanie poczty pod konsolą linuxa – komenda mail
From time to time you want to send yourself a file from the server. A convenient method is to send a file using email. Of course, this is done so rarely that I never remember the syntax:)
Here’s an example how to send mail with content of the script (text file):
mail recipient@bby.com.pl -s „subject” < /sbin/script
In this example we send the contents of the file /sbin/script as a text message to the „recipient” with subject „subject”.Raz na jakiś czas trzeba wysłać sobie jakiś plik z serwera. Wygodną metodą jest wysłać plik przy pomocy maila. Oczywiście robi się to na tyle rzadko, że nigdy nie pamiętamy składni 🙂 Poniżej przykład wysłania maila wraz z zawartością skryptu (plik tekstowy):
mail adres_odbiorcy@bby.com.pl -s „temat” < /sbin/skrypt
W tym przykładzie wysyłamy zawartość pliku /sbin/skrypt jako treść listu na adres odbiorcy o temacie „temat”.