Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

how to send email using formatted excel worksheet as email body ?

$
0
0

Hi there,

does anybody know how to adjust this below code to use formatted excel worksheet as body content email ?

thanks

Add-PSSnapin Microsoft.Exchange.Management.Powershell.Admin -erroraction silentlyContinue
$smtpServer = "10.10.10.10."
$msg = new-object Net.Mail.MailMessage
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$msg.From = "sample@dummyemail.com"
$msg.To.Add("sample@dummyemail.com")
$msg.Subject = "Test"
#$msg.Body = "Test"
$msg.IsBodyHTML = $true
$msg.Body = Get-Content ("test.html")
$smtp.Send($msg)
$att.Dispose()



Viewing all articles
Browse latest Browse all 15028

Trending Articles