Nagpur Cha SysAdmin is a blog about tips, tricks, free PowerShell scripts, free tools and easy solutions for various day to day and advance tasks of system administrators.

Search This Blog

Tuesday 5 July 2016

Verifying working of SMTP by sending test email from server Using PowerShell.

Hi All,

This is simple article about a script to check working of SMTP server.


1.       Script will ask you for your mail ID, here you have to enter your email ID.

 
2.       Script will send an email to the provided mail ID using server`s local SMTP (127.0.0.1)

3.       Mail will look like below, Mail will contain the message and server name from which it has been triggered

 
Script :
#=====================
$mymail = Read-Host 'your email id'

Send-MailMessage -to $mymail -From "$env:COMPUTERNAME@local.com" -Subject "SMTP Test Mail From Server: $env:COMPUTERNAME" -Body "If you Recived this email, then consider SMTP is Working on Server:$env:COMPUTERNAME" -SmtpServer 127.0.0.1
#===================== 

Kindly Share your experience in comment section with my blog/post if it did help you !!

Stay Blessed!!  
Thank You!!

No comments:

Post a Comment

Comments system