$Body = “get the information here to show the data with attachement”  | Set-Content C:\somename.html

$file = “C:\somename.html”
$EmailFrom = “FromMail@Domain.com”
$EmailTo = “ToMail@Domain.com”
$SMTPServer = “Your Smtp Server Name”
$EmailSubject = “Enter Your Subject”
$att = new-object Net.Mail.Attachment($file)

#Send mail with attachment
$mailmessage = New-Object system.net.mail.mailmessage
$mailmessage.from = ($EmailFrom)
$mailmessage.Subject = $EmailSubject
$mailmessage.Body = $Body
$mailmessage.IsBodyHTML = $true
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer)

Show Buttons
Hide Buttons

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.