Skip to content

About

PowerShell test script for Raw SMTP diagnostic.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Test-SmtpSend.ps1

PowerShell test script for Raw SMTP diagnostic.

.SYNOPSIS

SMTP send diagnostic - implicit TLS (port 465) or STARTTLS (port 587), with authentication.

.DESCRIPTION

Uses raw TcpClient + SslStream. Send-MailMessage / System.Net.Mail.SmtpClient are not used:
they are obsolete and cannot do implicit TLS on port 465.
Logs each stage: DNS, TCP, TLS (protocol, cipher, certificate), full SMTP dialog (credentials masked),
AUTH, MAIL/RCPT/DATA. On failure reports the failed stage plus a likely cause.

.EXAMPLE

.\Test-SmtpSend.ps1 -SmtpServer smtp.example.com -Port 465 -From test@example.com -To admin@example.com

.EXAMPLE

$cred = Get-Credential
.\Test-SmtpSend.ps1 -SmtpServer smtp.example.com -Port 587 -From test@example.com -To admin@example.com -Credential $cred -LogPath .\smtp-test.log

About

PowerShell test script for Raw SMTP diagnostic.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages