6 Replies Latest reply on Sep 15, 2019 10:23 PM by ganapa2000

    Unable to add image to report

    ganapa2000 Hot Shot



      I have issues adding the image embedded to the email body, it is not showing.


      Please help




      Get-VM | Get-CDDrive | select @{N="Folder";E={$_.Parent.Folder.Name}}, @{N="VM";E={$_.Parent.Name}}, @{N='ISO Path';E={$_.IsoPath}} | ConvertTo-Html <H2> All the ISO`s has been unmounted from the below listed VMs </H2>" -Property Folder, VM, 'ISO Path' -PostContent $post > $reportlocation


      #Send Email Configuration

      $att = "<br/><img src='D:\logo.png'/><br/>"

      $body = Get-Content $reportlocation -Raw

      Write-Host "Report has exported as HTML file" : $reportlocation

      Send-Mailmessage -From $FromAddress -To $ToAddress -Subject $Subject -Body $att+$body -BodyAsHtml -Attachments $reportlocation1 -SmtpServer $SMTPServer

      Write-Host "Report has been sent by E-mail to " $ToAddress " from " $FromAddress