Geeks With Blogs

News

qrcode

Lance Robinson

Create Your Badge

Lance Robinson is a software engineer in Durham, Chapel Hill, Raleigh, and surrounding areas. More about Lance.

 Subscribe


Lance's TextBox » About Me » My Resume »Twitter

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 = "lancer@nsoftware.com" }
"home" { $target = "lmrobins@gmail.com" }
}
send-email -from lancer@nsoftware.com -to $target -subject ("Todo: " + $msg) -message $msg -server 10.0.1.1
}

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

PS>todo home “remember to buy apples”

or

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: GeeksWithBlogs.net