I recently compiled a tiny command line SMTP mailer that you might find useful. It can send out plain text files as well as encoded binary attachments. You could use it, for example, to automate the sending out of "proprietary" TV sat codes available on a variety of web pages. In a series of scripts, you would use wget to grab a page with recent codes, parse them to grab the codes of interest, format them for your own purposes and send them out automatically to a few friends. All this could take place automatically at regular intervals using cron. What would be particularly pleasing is that you wouldn't have to open a web browser, inspect each page manually for what you want and load a mail client such as sylpheed to do the sending. The program is also useful for mailing notifications regarding system status (e.g. sending the results of "cat /var/log/messages | grep err").
There is an email.conf file in /usr/local/etc/email that requires editing before you can run this program. Simply indicate your SMTP server and login parameters etc. and away you go. If you want to have separate system-wide and personal configurations, copy email.conf to /root/.email.conf (notice the preceding dot) and make changes to the latter. The file in /root will override the global settings.
A sample script to launch email looks like this:
Code: Select all
#!/bin/sh
p1="any_old_user@gmail.com" # This is the "to address"
p2="-s This is my test subject" # This is the "subject"
p3="/tmp/mytext.txt" # This is the plain text file to send as "body text"
email $p1 "$p2" < $p3
With kind regards,
vovchik