Ceci est une ancienne révision du document !
Envoyer un mail
$ mail -s "Hello World" someone@example.com Cc: Hi Peter How are you I am fine Good Bye <Ctrl+D>
$ mail -s "This is the subject" somebody@example.com <<< 'This is the message' $ echo "This is the body" | mail -s "Subject" -aFrom:Harry\<harry@gmail.com\> someone@example.com $ mail -s "Hello World" user@yourmaildomain.com < /home/user/mailcontent.txt $ echo "This is the message body" | mail -s "This is the subject" mail@example.com
– source: http://www.binarytides.com/linux-mail-command-examples/
Outils plus performant que mail: mutt
apt install mutt
Envoyer un fichier en pièce jointe
echo "message" | mutt -a "/path/to/file.to.attach" -s "sujet du mail" -- adresse@mail.com