-1

I have this bash script that prepares and sends an email using SSMTP. The line that sends the message looks like this:

/usr/local/sbin/ssmtp -vvvv $recipients < $mail_file

$recipients: the recipient list $mail_file: the mail file

How would I attach a "/var/logs/foo.log to this mail? NB: An SSMTP-only solution is needed.

SCilek
  • 1

1 Answers1

-1

Well... It turned out that this works just fine:

cat $mail_file | (cat - && uuencode /var/log/foo.log foo.log) | /usr/local/sbin/ssmtp -vvvv $recipients
SCilek
  • 1