Mail merge times out

I have used mail merge to send 400 emails. During the sending the connection timed out.

The error message is a horrible Python error and not a nice pop-up explaining the error.

I pressed continue, but this did not cause the sending to continue: It seems the SMTP-object does not handle timeouts very well.

Is there a way I can tell the SMTP-object that it should retry thrice, if sending fails?