Reputation: 15
I had been trying to automate the process of sending mails along with attachments via my outlook account using Powershell.
$OL = New-Object -ComObject outlook.application
Start-Sleep 5
<#
olAppointmentItem
olContactItem
olDistributionListItem
olJournalItem
olMailItem
olNoteItem
olPostItem
olTaskItem
#>
#Create Item
$mItem = $OL.CreateItem("olMailItem")
$mItem.To = "[email protected]"
$mItem.Subject = "PowerMail"
$mItem.Body = "SENT FROM POWERSHELL"
$mItem.Send()
Stuck with adding attachments in the code. Please help me out.
Upvotes: 0
Views: 411