您现在的位置是:网站首页> 编程资料编程资料
Powershell中调用邮件客户端发送邮件的例子_PowerShell_
2023-05-26
354人已围观
简介 Powershell中调用邮件客户端发送邮件的例子_PowerShell_
你可以使用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
您可能感兴趣的文章:
相关内容
- Powershell从注册表中查询默认MAPI客户端的例子_PowerShell_
- PowerShell远程安装MSI安装包、EXE可执行程序的方法_PowerShell_
- 类似rpm包管理器的Windows Installer PowerShell Module简介_PowerShell_
- PowerShell脚本源码输出到文件的最佳写法_PowerShell_
- PowerShell批量安装msi后辍软件的方法_PowerShell_
- PowerShell捕获错误的2种方法(异常捕获命令、错误变量)_PowerShell_
- 自定义PowerShell控制台提示符风格的方法_PowerShell_
- PowerShell比较文本文件的两个方法_PowerShell_
- PowerShell计算脚本执行时间的实现方法_PowerShell_
- PowerShell多线程执行前后台作业的例子_PowerShell_
