Skip to content

Instantly share code, notes, and snippets.

@halr9000
Created July 12, 2012 03:08
Show Gist options
  • Save halr9000/3095431 to your computer and use it in GitHub Desktop.
Save halr9000/3095431 to your computer and use it in GitHub Desktop.
for alex
Param (
[Parameter(Mandatory=$true, ValueFromPipeline=$true)]
$Recipient
)
Begin {
# Edit these as needed
$MailParam = @{
From = "[email protected]"
Subject = "Your vExpert Eval Keys"
SmtpServer = "smtp.vmware.local"
}
Write-Host -ForegroundColor Green ( "{0} job start" -f ( get-date ) )
}
Process {
$body = @"
This is the email body. Replace the text as necessary. Don't forget
to leave in place the special tokens that will get replaced as
needed.
Email Address: {0}
License Key: {1}
"@ -f $Recipient.Email, $Recipient.License
Send-MailMessage @MailParam -Body $body
}
End {
Write-Host -ForegroundColor Green ( "{0} job complete" -f ( get-date ) )
}
@halr9000
Copy link
Author

If you wanted to do HTML email, you can just by changing the "-body" to "-bodyhtml".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment