Created
July 12, 2012 03:08
-
-
Save halr9000/3095431 to your computer and use it in GitHub Desktop.
for alex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ) ) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you wanted to do HTML email, you can just by changing the "-body" to "-bodyhtml".