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

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
 
S

Steve

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top