[英]Mail Automation Task using Powershell
I had been trying to automate the process of sending mails along with attachments via my outlook account using Powershell.我一直在尝试使用 Powershell 通过我的 outlook 帐户自动发送邮件和附件。
$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 = "PlayingWithPowershell@gmail.com"
$mItem.Subject = "PowerMail"
$mItem.Body = "SENT FROM POWERSHELL"
$mItem.Send()
Stuck with adding attachments in the code.坚持在代码中添加附件。 Please help me out.请帮帮我。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.