Created
December 14, 2011 17:26
-
-
Save jpoehls/1477549 to your computer and use it in GitHub Desktop.
SMTP Test Script (in PowerShell)
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
$smtp = New-Object System.Net.Mail.SmtpClient | |
$smtp.Host = "127.0.0.1" | |
$smtp.Port = 587 | |
$creds = New-Object System.Net.NetworkCredential | |
# $currentCreds = Get-Credential | |
$creds.Domain = "" | |
$creds.UserName = "my_user" # $currentCreds.UserName | |
$creds.Password = "my_pass" # $currentCreds.GetNetworkCredential() | |
$smtp.Credentials = $creds | |
$smtp.Send("[email protected]", "[email protected]", "My Subject", "My Message") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you!