Usually refers to an network error. Reyling allowed on the smtpserver? Try with IP-adress instead of DNS name. Make sure it's the correct port for the smtp server.
Please note that you are creating a CDO-object so you need to have collaboration data objects installed on the machine running the macro. I'm not 100% sure on this but I believe MS stopped shipping CDO since Outlook 2007 so you would need to manually install it.
I'm trying to send email from an address in the domain of my company to an outside address (in another domain but also on address like gmail or yahoo...). I tried your solution (and many others !) but I haven't find the good solution.
(The same macro works well to send email in the same domain and from a GMail account to other address)
The code works perfectly. However, it is using schema.microsoft .... where my scenario is, the server has blocked internet access, besides sending the mail to exchange server (within the same domain). Is there any reference on macro, for sending mail using SMTP to exchange server? I have tested the SMTP mail through QMC, it works though.