Transport Failed to Connect to Server

221 views Asked by At

I have a code to send mail from a VBA macro using CDO.

The code works fine and send an email when there is internet connection

The code to send an email is called many times at different stages of an overnight batch process

When there is no internet connection an error pops up "Transport Failed to Connect to Server". Given the batch job is running at night and it is a long process, I would love the script carring on if it cannot send the mail rather than stopping. In order to do so I have tried the following but it doesn't seem to work.

On Error Resume Next 
Call subSendEmailGmail(False, "Batch about to start", "") 
On Error goto 0

Does anyone have a suggestion on how to make the job keep running in case the mail cannot be sent?

0

There are 0 answers