An example of sending an email notification post upload in the user's "scripts/commands" - "post upload command' field.
call with:
powershell.exe -file c:\path\sendmail.ps1 "%1"
sendmail.ps1
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = { return $true }
$EmailFrom = "you@youremail.com"
$EmailTo = "to@otherdomain.com"
$Subject = "Upload completed"
$Body = $args[0]
$SMTPServer = "mail.youremailserver.com"
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587)
$SMTPClient.EnableSsl = $true
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential("yourdomain\youraccount", "yourpassword");
$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)
You may need to set the following command in powershell manually:
Set-ExecutionPolicy unrestricted
Sending notifications to Exchange Servers (NTLM)
-
- Site Admin
- Posts: 988
- Joined: Mon Mar 24, 2003 4:37 am