The Send-MailMessage Cmdlet

Send-MailMessage may be one of my favorite Powershell cmdlets these days.  As I’m sure you’ve guessed, it’s used for sending email- plain and simple.

While this can’t be said for all cmdlets, the syntax is very intuitive and straightforward.

Here’s an example:

Send-mailmessage -to -from -subject "test" -smtpserver

You’ll find a bunch of other optional parameters here.

I’ve made use of this cmdlet in testing email relay configurations and even in new user provisioning scripts in Office365.

Anyone doing any level of Windows system administration should have this one in their toolkit.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s