Concurrent with my last post on using mail from the command line there was a thread on the Mac OS X Server email list on using attachments with mail, so I thought I would supplement what they were doing there here (so if you were following that thread the only new thing here are the -c and -b options). Let’s say you have a file on your desktop called orgchart.doc and you wanted to attach it to an email and send it to a few email addresses: contact@org.com, contact2@org.com and krypted@mac.com. We’re also going to bcc secret@org.com. You would use the following command: uuencode ~/Desktop/orgchart.doc orgchart.doc | mail -s “orgchart”…
-
-
Automatically Emailing Logs
As I have mentioned in the past, you can send mail from the command line by initiating a telnet session into port 25 of a mail server. Provided you have setup Mail.app you can also email from the command line using the mail command. In the below command we’re going to pipe the contents of a log file into an email by reading the contents using a cat command. From the output of the cat command we’re then going to email the contents of the file to an email address, specifying the subject line of the email using the -s option of the ppp command: cat /var/log/ppp.log | mail -s…