IslandJohn.com
18Dec/080

Relay Mail from the Command Line on Leopard

I have some scripts that need to send mail form the command line (Terminal.app, shell, cron, at, launchd etc.). While the "mail" command works out of the box as configured - delivering mail on its own, - it will not work if your ISP blocks port 25 or your ISP's network address range is on a blacklist. You could use the "Mail.app" and Apple Script, but that requires that the user in question be logged in, and may not work for scripts run from "cron" or by "root".