Scott Hanselman has a little TODO batch file that he uses to quickly email himself notes from the command line. I have something similar, but mine is a PowerShell script that uses NetCmdlets. The cool thing about the send-email cmdlet in NetCmdlets is that it supports SSL as well as other email features like html mail and attachments. There are separate cmdlets for sending other types of messages like Usenet newsgroup articles, Jabber IMs (ie, Google Talk), SMS messages, SNMP traps, etc.
Here is my script:
param( [string] $target = "work",
[string] $msg )
switch ($target)
{
"work" { $target = "me@mydomain.com" }
"home" { $target = "mailto:%22%20%7B%20$target%20=%20%22@me@myotherdomain.com" }
}
send-email -from me@mydomain.com -to $target -subject ("Todo: " + $msg) -message $msg -server 10.0.1.1
And here's how I use it:
If I wanted I could use the get-dns cmdlet to find out the appropriate mail server for the recipient address and send directly to that server rather than hard-coding my own.