New
#1
Any Powershell Guru's out there?
Having trouble with a backup script for Veeam which is supposed to backup all my VM's and then email a report.
After a bit of tweaking the script works as far as the backup goes and backs up all the VM's to my Synology NAS.
Trouble I am having is that it will not send the email report. The last bit of the script looks like this
If I run this in the PowerShell ISE windowed interface all it does is output the above to the console and does not send the email.Code:{ $Message = New-Object System.Net.Mail.MailMessage $EmailFrom, $EmailTo $Message.Subject = $EmailSubject $Message.IsBodyHTML = $True $message.Body = $MesssagyBody | ConvertTo-Html -head $style | Out-String $SMTP = New-Object Net.Mail.SmtpClient($SMTPServer) $SMTP.Send($Message) }
Do I just remove the curly brackets? I would have thought it should have run with the curly brackets anyway.
This is not a script I wrote but one I have adapted to my system but the bottom part said not to change things past a certain point.
Thanks.