Powershell中调用邮件客户端发送邮件的例子
时间:2021-09-15 10:43:07|栏目:|点击: 次
你可以使用Send-MailMessage发送邮件,但是你想从你默认MAPI客户端准备发送一份邮件,这也不是很麻烦:
复制代码 代码如下:
$subject = 'Sending via MAPI client'
$body = 'My Message'
$to = 'tobias@powertheshell.com'
$mail = "mailto:$to&subject=$subject&body=$body"
Start-Process -FilePath $mail
$body = 'My Message'
$to = 'tobias@powertheshell.com'
$mail = "mailto:$to&subject=$subject&body=$body"
Start-Process -FilePath $mail
这个脚本的优势就是向用户发送邮件。只要你安装了MAPI客户端,它将自动打开邮件并填充脚本指定信息。但你必须手动发送这份邮件。
文章出处:http://www.pstips.net/sending-email-via-outlook.html
栏 目:
下一篇:docker 容器上编译 go 程序提示找不到文件问题
本文标题:Powershell中调用邮件客户端发送邮件的例子
本文地址:http://www.codeinn.net/misctech/175073.html






