Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. ## $emailAddress = send to,
  4. ## $emailSubject = subject of e-mail
  5. $emailAddress = Read-Host -Prompt "Input E-Mail Address"
  6.  
  7. # Going to dynamically build .SQL files within a certain folder to this e-mail subject line
  8. $emailSubject = Read-Host -Prompt "Input E-Mail Subject"
  9.  
  10. $emailBody = Read-Host -Prompt "Input E-Mail Body"
  11.  
  12. $ol = New-Object -comObject Outlook.Application
  13. $mail = $ol.CreateItem(0)
  14. $Mail.Recipients.Add($emailAddress)
  15. $Mail.Subject = $emailSubject
  16. $Mail.Body = $emailBody;
  17. $Mail.Send()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement