I think I have this sorted out -- the main issue was me not understanding the mechanisms of scope, delegates and callbacks.

Another issue was that the callback to tlsContextSetup was missing in vibe.mail.smtp.sendEmail when settings.connectionType == SMTPConnectionType.startTLS - I'll submit a quick pull request.

Nathan