Articles → POWERSHELL → Send An Email Using Powershell Script

Send An Email Using Powershell Script






Steps




  1. Open notepad.
  2. Write following code in notepad
  3. $Outlook = New-Object -ComObject Outlook.Application
    $Mail = $Outlook.CreateItem(0)
    $Mail.To = "abc@gmail.com"
    $Mail.Subject = "Test Subject"
    $Mail.Body ="Test mail"
    $Mail.Send()


  4. Save it as test.ps1.
  5. Right click on the file and click on ‘Run with PowerShell’.



Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, April 16, 2019

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250