Geeks With Blogs

Lance's TextBox

I’ve talked about this before, but it came up again today so I thought I’d do a quick post about it.  Here’s a function I use in my PowerShell profile that uses NetCmdlets to send quick “todo” emails:

function todo($target="work", $msg) {
switch ($target)
"work" { $target = "" }
"home" { $target = "" }
send-email -from -to $target -subject ("Todo: " + $msg) -message $msg -server

During the day, when I need to send myself a reminder, I can just say:

PS>todo home “remember to buy apples”


PS>todo work "schedule meeting with Mark and his team"


This is always faster than bringing up my email client, composing a new message and clicking send.  You’ll notice that my function uses the send-email function from NetCmdlets, but just substitute your own email code if necessary.

Technorati Tags: ,
Posted on Tuesday, October 20, 2009 8:07 AM PowerShell | Back to top

Comments on this post: PowerShell Command Line Emailer

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Lance Robinson | Powered by: