Using VBA code in ThisOutlookSession - Can I send an email asynchronously?

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

I have a small routine that uses the .Send method of a MailItem object
to send a message.
The problem I can't get around is that the macro hangs until the
message is sent.
I'd rather initiate the Send event, cross my fingers, and let the code
proceed.
I'm really not even interested in an event-handler to determine if/
when the message was successfully sent.
I just don't want to make the user wait. If the message fails to send,
it can stay in the outbox...

Thanks,

Steve-lvl70holypriest
 
Thanks for the reply. I don't want to defer the transmission of the
message. I want to send it immediately.
I just want the code to continue after the attempted "send".
If the exhange server is down or the network is down, the code just
sits and waits until the message is sent.
I want it to continue (related code snippet below)

Steve

With objMail
.BodyFormat = olFormatPlain
.To = NewTo
.Subject = NewSubject
.Body = NewBody
.DeleteAfterSubmit = True
.Send 'HANGS HERE UNTIL MESSAGE SENDS
End With
 
Back
Top