title: Sending Outlook E-mail using Powershell
body: <p>I'm interested in using Powershell to send e-mail through Outlook using a single line of code. The closest thing I've found is this command for Gmail:</p>
  
  <pre><code>Send-MailMessage -smtpServer 'smtp.gmail.com' -port 587 -from 'myself@gmail.com' -to 'myself@gmail.com' -subject 'Test' -body 'Body' –UseSsl
  </code></pre>
  
  <p>But I want to do something similar with Outlook. Is there a way to take the short script below and turn it into a single line of code? Thanks!</p>
  
  <pre><code>$Outlook = New-Object -ComObject Outlook.Application
  $Mail = $Outlook.CreateItem(0)
  $Mail.To = "name@domain.com"
  $Mail.Subject = "Subject of E-Mail"
  $Mail.Body ="Text of Body"
  $Mail.Send()
  </code></pre>