-
-
Save fcenobi/4811f1d7bfde97cbce4295373803863f 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