i got this error while running the code below,
it runs fine in the pc at home,
but not running in friends computer
who is using the different IP giving this error......
i tried to configure outlook and all smtp settings,
i disabled firewalls, disabled antivirus
I have get something sometime if I used different mail properties for host ,port etc.
So I think you should test with other mail setting if it working or not if that work then issue may be in host.