none
outlook延时传递 RRS feed

  • 问题

  • outlook延时传递

    我是OUTLOOK2010,用EXCHANGE连接服务器的。我用延时传递的选项,当我在11点建立一个延时传递的邮件需要12点发送。当12点发送出去后,对方收到我邮件显示的发送时间是11点,我有什么办法可能令对方看到我发送的时间是12点?
    2013年3月6日 8:52

答案

  • 您好,

    可以使用宏来完成指定时间发送邮件的任务,参考如下的代码范例:

    1. 打开 Outlook, 按下 Alt + F11 打开 VBA 编辑器

    2. 点击插入- > 模块

    3. 将以下的代码范例复制黏贴到新建的模块中

    4. 打开一个新建邮件的窗口,单击工具栏的空白处,并点击自定义功能区,点击新建组,可任意命名

    5. 点击左上方下拉列表,点击宏,找到 DelayDelivery,双击以添加至上一步所新建的组中,可任意命名,并修改图标

    至此即可,以后可以使用此按键来代替 Outlook 自带的延时传递功能

    Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerfunc As Long) As Long
    Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
    Public TimerID As Long
    Public Sub DelayDelivery()
    Dim Transfer_TTS As Long
    Dim SendTime As Integer
        TimeToSend = InputBox(Prompt, "请设定发送邮件的时间", "24:00")
        If Len(TimeToSend) <> 0 Then
        Transfer_TTS = Left(TimeToSend, 2) * 60 * 60 + Right(TimeToSend, 2) * 60
        SendTime = Transfer_TTS - Timer
        Call ActivateTimer(SendTime)
        Dim CurrentMessage As MailItem
        Set CurrentMessage = ActiveInspector.CurrentItem
        Email_Tile = CurrentMessage.Subject
        Email_Body = CurrentMessage.HTMLBody
        CurrentMessage.Close (olSave)
        End If
    End Sub
    Public Sub ActivateTimer(ByVal nSeconds As Long)
      nSeconds = nSeconds * 1000
      If TimerID <> 0 Then Call DeactivateTimer
      TimerID = SetTimer(0, 0, nSeconds, AddressOf TriggerTimer)
      If TimerID = 0 Then
        MsgBox "The timer failed to activate."
      End If
    End Sub
    Public Sub DeactivateTimer()
    Dim lSuccess As Long
      lSuccess = KillTimer(0, TimerID)
      If lSuccess = 0 Then
        MsgBox "The timer failed to deactivate."
      Else
        TimerID = 0
      End If
    End Sub
    Public Sub TriggerTimer(ByVal hwnd As Long, ByVal uMsg As Long, ByVal idevent As Long, ByVal Systime As Long)
        Dim oOa As New Outlook.Application
        Dim oNS As Outlook.NameSpace
        Dim oFldr As Outlook.MAPIFolder
        On Error Resume Next
        Set oNS = Application.Session
        Set oFldr = oNS.GetDefaultFolder(olFolderDrafts)
        For Each oMessage In oFldr.Items
            If oMessage.Subject = Email_Tile And eMessage.HTMLBody = Email_Body Then
                oMessage.Send
            End If
        Next
        Set oNS = Nothing
        If TimerID <> 0 Then Call DeactivateTimer
    End Sub


    Max Meng
    TechNet Community Support

    2013年3月8日 9:59
    版主