email client, and it works perfectly.
What I would like to know, if there is a way to run this powershell code from a compiled Autohotkey script,
without saving below code into a .ps1 file (because that would expose the username / password.
Code: Select all
$EmailFrom = "[email protected]"
$EmailTo = "[email protected]"
$Subject = "PowerShell Test"
$Body = "Hi There !"
$SMTPServer = "smtp.provider.com"
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587)
$SMTPClient.EnableSsl = $true
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential("SomeUserName", "SomePassword");
$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)
using AHK, but first I need to figure out how to run above code.
Any ideas ?