What I'm attempting to do is send an email using VBA in excel though outlook but with a defered send date/time for the next day about 8:30. The code bellow, will send an email fine, it will even send one with a derfered send time even when my workstation is locked, however it seems when i set it to next day 8:30 they just stay in my outbox untill I open them up and hit, I can even open them up and hit send before the defered time and they will send fine, or after and they will send imediatly.
The deferedtime variable passed in is a string formated "dd/mm/yyyy hh:mm:ss" e.g "15/10/2010 08:30:00"
Sub Send_Outlook_Email(Addresses, attach, strSubject, strBody, defertime)
Dim objOL As Outlook.Application
Dim msg As Outlook.MailItem
Set objOL = New Outlook.Application
Set msg = objOL.CreateItem(olMailItem)
Dim d As Date
strEmail = ""
For i = 0 To UBound(Addresses)
strEmail = strEmail & Addresses(i) & "; "
Next
strEmail = Trim(strEmail)
With msg
.To = strEmail
.subject = strSubject
.HTMLBody = strBody
For i = 0 To UBound(attach)
strAttach = attach(i)
If Len(strAttach) > 0 And Len(Dir(strAttach)) > 0 Then
.Attachments.Add (strAttach)
End If
Next
.DeferredDeliveryTime = defertime
.Send
End With
End Sub
Am I missing something important?