update scripts
This commit is contained in:
parent
566cebdc96
commit
a5a3637b5c
14 changed files with 6289 additions and 5805 deletions
24
Scripts/Send-SMTP.psm1
Normal file
24
Scripts/Send-SMTP.psm1
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
function Send-SMTP {
|
||||
param (
|
||||
[Parameter(Mandatory = $True)]$mess
|
||||
)
|
||||
$srv_smtp = "smtp.yandex.ru"
|
||||
$port = "587"
|
||||
$from = "login1@yandex.ru"
|
||||
$to = "login2@yandex.ru"
|
||||
$user = "login1"
|
||||
$pass = "password"
|
||||
$subject = "Service status on Host: $hostname"
|
||||
$Message = New-Object System.Net.Mail.MailMessage
|
||||
$Message.From = $from
|
||||
$Message.To.Add($to)
|
||||
$Message.Subject = $subject
|
||||
$Message.IsBodyHTML = $true
|
||||
$Message.Body = "<h1> $mess </h1>"
|
||||
$smtp = New-Object Net.Mail.SmtpClient($srv_smtp, $port)
|
||||
$smtp.EnableSSL = $true
|
||||
$smtp.Credentials = New-Object System.Net.NetworkCredential($user, $pass);
|
||||
$smtp.Send($Message)
|
||||
}
|
||||
|
||||
# Send-SMTP $(Get-Service)
|
||||
Loading…
Add table
Add a link
Reference in a new issue