 $EmailParams = @{ To = $To Subject = "Users and their Groups Report $(Get-Date -format dd/MM/yyyy)" Body = $Email BodyAsHtml = $True Priority = "High" UseSsl = $True Port = "000" SmtpServer = "smtp.office000.com" Credential = $EmailCredentials From = $From} send-mailmessage @EmailParams 