Email 使Powershell V2从mailto链接打开新邮件
我正在尝试获取Powershell V2脚本,在默认邮件应用程序中打开一个新的邮件消息窗口,并预先填写收件人、抄送、主题和正文字段。在批处理脚本中,我只需使用mailto函数,它工作得非常好。但是,我无法在Powershell中实现这一点,Send-MailMessage cmdlet正在询问用户可能不具备的信息 脚本将由多个用户使用,因此我无法将发送方/服务器信息硬编码到脚本中;用户还需要能够在发送电子邮件之前对其进行更改 是否有一个cmdlet允许我只填写我前面提到的四个字段,在默认邮件应用程序中打开(无论在系统中如何设置),并允许用户在发送之前对邮件进行更改Email 使Powershell V2从mailto链接打开新邮件,email,powershell,mailto,Email,Powershell,Mailto,我正在尝试获取Powershell V2脚本,在默认邮件应用程序中打开一个新的邮件消息窗口,并预先填写收件人、抄送、主题和正文字段。在批处理脚本中,我只需使用mailto函数,它工作得非常好。但是,我无法在Powershell中实现这一点,Send-MailMessage cmdlet正在询问用户可能不具备的信息 脚本将由多个用户使用,因此我无法将发送方/服务器信息硬编码到脚本中;用户还需要能够在发送电子邮件之前对其进行更改 是否有一个cmdlet允许我只填写我前面提到的四个字段,在默认邮件应用
我已经为此寻找了一个月的答案,到目前为止还没有成功。如蒙协助,将不胜感激 如果您在
mailto:
方案中提供URI以启动进程
,Windows将自动计算与之关联的应用程序(无论是Outlook、Thunderbird、Windows Mail还是您喜欢的任何应用程序)并启动它:
e、 g:
与任何其他URI一样,mailto:
URI可以附加查询:
PS C:\> Start-Process "mailto:dhub01@domain.tld?Subject=This is a Subject&Cc=dhub02@domain.tld&Body=This is the contents of the message"
# The message is created with the above values in place (at least in Outlook)
如果您在
mailto:
方案中提供URI以启动进程
,Windows将自动计算出与其关联的应用程序(无论是Outlook、Thunderbird、Windows Mail还是您喜欢的任何应用程序)并启动它:
e、 g:
与任何其他URI一样,mailto:
URI可以附加查询:
PS C:\> Start-Process "mailto:dhub01@domain.tld?Subject=This is a Subject&Cc=dhub02@domain.tld&Body=This is the contents of the message"
# The message is created with the above values in place (at least in Outlook)
我可以确认Mathias的语法:
PS C:\> Start-Process "mailto:dhub01@domain.tld?Subject=This is a Subject&Cc=dhub02@domain.tld&Body=This is the contents of the message"
# Start-Process immediately returns but a new mail message is launched
也适用于Thunderbird。我可以确认,Mathias的语法:
PS C:\> Start-Process "mailto:dhub01@domain.tld?Subject=This is a Subject&Cc=dhub02@domain.tld&Body=This is the contents of the message"
# Start-Process immediately returns but a new mail message is launched
也适用于雷鸟