When I run the following powershell script to send an e-mail :
$Outlook = New-Object -ComObject Outlook.Application
$file = Get-ChildItem -Path "H:\TP65655\IDX CVA\UAT" -Include *.idx -Recurse | Where {$_.CreationTime -gt (Get-Date).AddDays(-1)}
$atts = $file.fullname
$Mail = $Outlook.CreateItem(0)
$Mail.To = "email@domain.com"
$Mail.Subject = "Testing E-mail Automation"
$Mail.Body = "UAT TEST"
Try
{
$Mail.Attachments.Add($atts)
$Mail.Send()
Write-Host "Mail Sent Successfully"
Read-Host -Prompt “Press Enter to exit”
}
Catch
{
Write-Host "File Not Attached Successfully, Please Try Again"
Read-Host -Prompt “Press Enter to exit”
Exit
}
The following pops up from Outlook :
Is there any way I can remove this without changing the programmatic access in Trust Center to "Never" as this is an organization desktop and that option is not feasible.