Eu sou novo para o Ubuntu. Alguém pode me ajudar como enviar e-mails do terminal?
I'm new to Ubuntu. Can anybody help me about how to send emails from terminal?
Hmm, I am a bit rusty on this, so forgive me if it is not exactly right :-)
If you have an ubuntu host with properly configured sendmail then you can encode the file as base64 uuencode and pipe it to sendmail:
cat myfile.txt | uuencode --base64 myfile.txt | mailx -s "subject" praveen@home
If you have another type of mail client then you have to explore what possibilitie you have to run that at the command line. The important point is the
uuencode --base64 filename.ext, which ensures the file is encapsulated properly so it is understood as an attachment by the recipient.
Install mailutils utility on the server. Make sure the SMTP server (Such as Postfix) is working properly on the server.
apt install mailutils
After installation. You can use the
mailx -A testfile.txt -s "testmail" firstname.lastname@example.org < /dev/null
mailx: Null message body; hope that's ok