[英]Send Email (Outlook 2016) via Powershell
我搜索了很多,發現了很多這樣的解決方案:
$ol = New-Object -comObject Outlook.Application
$mail = $ol.CreateItem(0)
$mail.Recipients.Add("empfänger@domain.com")
$mail.Subject = "Betreff: Info fuer den Empfaenger"
$mail.Body = "Hier können Sie Ihren Nachrichtentext übergeben. Gerne auch in Form einer Variablen. Ihre Informationen, sollten dann aber als Objekt-Typ STRING vorliegen."
$Mail.Send()
但它不起作用。 有人知道這個問題嗎?
(Outlook 正在手動工作;我沒有使用 smtp 地址搜索解決方案..)
您很可能在 Outlook 中遇到了安全提示/問題。 Send
方法很敏感,因此如果您自動化 Outlook 發送電子郵件並在外部應用程序中調用Send
方法,您可能會收到安全提示。 “Security” in this context refers to the so-called “object model guard” that triggers security prompts and blocks access to certain features in an effort to prevent malicious programs from harvesting email addresses from Outlook data and using Outlook to propagate viruses and spam. 這些提示不能簡單地關閉,除非在 Outlook 2007 及更高版本中運行防病毒應用程序。
為避免出現安全提示或問題,您可以:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.