Send mail using CMD/PowerShell of WIN10
Step:01
Open power shell in windows 10
Step:02
Open the prompt
Step:03
Copy & Paste below items into power shell
$EmailFrom = “test@domain.com”
$EmailTo = “shariful.islam@bol-online.com”
$Subject = “Test Mail”
$Body = “Dear All, This is a test mail from power shell of WIN10”
$SMTPServer = “mail.domain.com”
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 25)
$SMTPClient.EnableSsl = $false
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential(“test”, “123456”);
$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body);
The execution will be error less if everything is alright.
Step:04
Check destination email address to confirm the delivery



Comments
Post a Comment