function email
{
param([string]$topic = "", [string]$subject = "")
$EmailTo = "
$mailmessage = New-Object system.net.mail.mailmessage
$mailmessage.from = ("
$mailmessage.To.add($emailto)
$mailmessage.Subject = "$topic " + (Get-Date).GetDateTimeFormats("u")
$mailmessage.Body = "<html><head></head><body>" + $subject + "</body></html>"
$mailmessage.IsBodyHTML = $true
$SMTPClient = New-Object Net.Mail.SmtpClient("192.168.11.135", 25)
$SMTPClient.Send($mailmessage)
}
$lwt = Get-Date((Get-ChildItem path-to-file).LastWriteTime) -f "dd.MM.yyyy hh:mm:ss"
email "Отчет по выгрузке" "<html><body>Последняя выгрузка: file - $lwt<br>Последняя выгрузка: $lwt</body></html>"