Powershell 我无法将图像从桌面位置插入或粘贴到outlook邮件正文
我正在尝试通过将桌面上的图像插入outlook邮件正文 powershell脚本,包含以下脚本邮件正在发送,但图像未发送 邮件正文。请检查并告诉我哪里做错了。请注意我 不要图片作为附件,我希望它在邮件正文。请帮助它将 真的很可观。 下面是powershell脚本Powershell 我无法将图像从桌面位置插入或粘贴到outlook邮件正文,powershell,powershell-2.0,powershell-3.0,powershell-4.0,Powershell,Powershell 2.0,Powershell 3.0,Powershell 4.0,我正在尝试通过将桌面上的图像插入outlook邮件正文 powershell脚本,包含以下脚本邮件正在发送,但图像未发送 邮件正文。请检查并告诉我哪里做错了。请注意我 不要图片作为附件,我希望它在邮件正文。请帮助它将 真的很可观。 下面是powershell脚本 $file1 = "C:\Users\rony\Desktop\screenshot.png" sleep 02 $Outlook = New-Object -ComObject Outlook.Applicat
$file1 = "C:\Users\rony\Desktop\screenshot.png"
sleep 02
$Outlook = New-Object -ComObject Outlook.Application
$Mail = $Outlook.CreateItem(0)
$Mail.To = "rony7@gmail.com"
$Mail.Subject = "screenshot status"
$Mail.HTMLBody = @"
<html>
<body>
Hi ,
<p>Please find the below screenshots of status.
<p>
<img src="cid:image1.png">
<p>Thank you!
</body>
</html>
"@
$attachment = New-Object System.Net.Mail.Attachment($file1)
$attachment.ContentDisposition.Inline = $True
$attachment.ContentDisposition.DispositionType = "Inline"
$attachment.ContentType.MediaType = "image/png"
$attachment.ContentId = 'image1.png'
$Mail.Attachments.Add($attachment)
sleep 05
$Mail.Send()
$file1=“C:\Users\rony\Desktop\screenshot.png”
睡眠02
$Outlook=新对象-ComObject Outlook.Application
$Mail=$Outlook.CreateItem(0)
$Mail.To=”rony7@gmail.com"
$Mail.Subject=“屏幕截图状态”
$Mail.HTMLBody=@”
你好
请查看以下状态截图。
谢谢大家!!
"@
$attachment=新对象System.Net.Mail.attachment($file1)
$attachment.ContentDisposition.Inline=$True
$attachment.ContentDisposition.DispositionType=“Inline”
$attachment.ContentType.MediaType=“image/png”
$attachment.ContentId='image1.png'
$Mail.Attachments.Add($attachment)
睡眠05
$Mail.Send()
看看这篇博文嗨,我已经检查并创建了上面的脚本,但没有在邮件正文中反映的图像。请检查上述脚本一次,并让我知道我所犯的错误。您使用的是哪个outlook版本?outlook版本是2013