sendmail Command Sendmail is one of the most popular SMTP servers in Linux. You can easily send emails directly from the command line using the sendmail command. To route the information, the sendmail command makes use of the network configured on your system.
None of the mutt ones worked for me. It was thinking the email address was part of the attachemnt. Had to do:
echo "This is the message body" | mutt -a "/path/to/file.to.attach" -s "subject of message" -- [email protected]
Or, failing mutt:
gzip -c mysqldbbackup.sql | uuencode mysqldbbackup.sql.gz | mail -s "MySQL DB" [email protected]
Depending on your version of linux it may be called mail. To quote @David above:
mail -s "Backup" -a mysqldbbackup.sql [email protected] < message.txt
or also:
cat message.txt | mail -s "Backup" -a mysqldbbackup.sql [email protected]
From looking at man mailx
, the mailx program does not have an option for attaching a file. You could use another program such as mutt.
echo "This is the message body" | mutt -a file.to.attach -s "subject of message" [email protected]
Command line options for mutt can be shown with mutt -h
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With