使用 Powershell 发送延迟消息传递和更改默认帐户 [英] Sending defer message delivery and change default account using Powershell

查看:19
本文介绍了使用 Powershell 发送延迟消息传递和更改默认帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Outlook 2010 和 Powershell 2.0.

I use Outlook 2010 and Powershell 2.0.

我想发送一封 Outlook 邮件,并使用 Powershell 以编程方式延迟发送邮件.

I want send a Outlook message, and delay delivery programmatically of a message using Powershell.

如何创建新的 Outlook 电子邮件并立即推迟发送?

How can I create a new Outlook email and immediately defer delivery?

推荐答案

如果你试试这个:

$ol = New-Object -comObject Outlook.Application  
$mail = $ol.CreateItem(0)  
$mail | Get-Member

您将获得邮件对象上所有可用方法/属性的列表.

you'll get a list of all methods/properties available on the mail object.

一个属性是 DeferredDeliveryTime.你可以这样设置:

One property is DeferredDeliveryTime. You can set it like this:

#Stay in the outbox until this date and time
$mail.DeferredDeliveryTime = "11/2/2013 10:50:00 AM"

或者:

#Wait 10 minutes before sending mail
$date = Get-Date
$date = $date.AddMinutes(10)
$mail.DeferredDeliveryTime = $date

这篇关于使用 Powershell 发送延迟消息传递和更改默认帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆