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

Looking to send an e-mail using 365. I need to add an attachment.

$
0
0

Here is what I has so far and I am very close. I have tried many things. I added

$attachment = New-Object System.Net.Mail.Attachment("XXXXX")
But didn't work. The script below works for me I just need to add an attachment.

$EmailFrom = "XXXX.com"
$EmailTo = "XXXXX.com" 
$Subject = "Testing" 
$Body = "Thisisatest" 
$SMTPServer = "XX.XXX.XXX.XXX" 
$SMTPClient = New-Object Net.Mail.SmtpClient("Thisissmtp") 
$SMTPClient.EnableSsl = $true 
$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>