- reference: https://askubuntu.com/questions/12917/how-to-send-mail-from-the-command-line
- author: Marco Ceppi (https://askubuntu.com/users/41/marco-ceppi)
sudo apt-get install mailutilsmarco@dagobah:~$ mail -v marco.ceppi.use@gmail.com
Subject: Hello World!
This is an email to myself.
Hope all is well.
.
Cc: You terminate messages with a single . on line. That's when mail will prompt you for Cc: enter the information (or leave blank) and mail will then print out additional information on what it is attempting to do, as well as detailing the processing of connecting, transmitting, and receiving data from the mail server.
- reference: https://askubuntu.com/questions/12917/how-to-send-mail-from-the-command-line
- author: jet (https://askubuntu.com/users/3226/jet)
apt-get install libio-socket-ssl-perl libnet-ssleay-perl sendemailsendemail -f fromuser@gmail.com -t touser@domain.com -u subject -m "message" -s smtp.gmail.com:587 -o tls=yes -xu gmailaccount@gmail.com -xp gmailpassword - reference: https://askubuntu.com/questions/12917/how-to-send-mail-from-the-command-line
- author: Sid (https://askubuntu.com/users/4776/sid)
sudo apt-get install ssmtpEdit the ssmtp config file:
gksu gedit /etc/ssmtp/ssmtp.conf
Append the following text:
root=username@gmail.com
mailhub=smtp.gmail.com:465
rewriteDomain=gmail.com
AuthUser=username
AuthPass=password
FromLineOverride=YES
UseTLS=YESRun ssmtp and provide the recipient email address:
ssmtp recepient_name@gmail.com
Provide the message details as follows:
To: recipient_name@gmail.com
From: username@gmail.com
Subject: Sent from a terminal!Your content goes here. Lorem ipsum dolor sit amet, consectetur adipisicing. (Notice the blank space between the subject and the body.) Press Ctrl + D to send.
You can also put the text in file and send it as follows:
ssmtp recipient_name@gmail.com < filename.txt- reference: https://askubuntu.com/questions/12917/how-to-send-mail-from-the-command-line
- author: BozoJoe (https://askubuntu.com/users/6010/bozojoe)
apt-get install mpackmpack -s "file you wanted" ./data.pdf loser@supergoober.cn