vault backup: 2026-11-09 09:52:30
This commit is contained in:
1 parent
5022dc27b2
commit
d58a4b3fa9
4 files changed
+88
-8
No files matched your search
@@ -0,0 +1,18 @@
|
||||
param(
|
||||
[Parameter(Mandatory = $true)][string]$Smtp,
|
||||
[int]$Port = 465,
|
||||
[Parameter(Mandatory = $true)][string]$From,
|
||||
[Parameter(Mandatory = $true)][string]$To,
|
||||
[Parameter(Mandatory = $true)][string]$User,
|
||||
[Parameter(Mandatory = $true)][string]$Pass,
|
||||
[Parameter(Mandatory = $true)][string]$Subject,
|
||||
[Parameter(Mandatory = $true)][string]$Body
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$secure = ConvertTo-SecureString $Pass -AsPlainText -Force
|
||||
$cred = New-Object System.Management.Automation.PSCredential($User, $secure)
|
||||
|
||||
Send-MailMessage -SmtpServer $Smtp -Port $Port -UseSsl `
|
||||
-From $From -To $To -Subject $Subject -Body $Body `
|
||||
-Encoding UTF8 -Credential $cred
|
||||
Reference in new issue
Block a user