I had trouble sending mail using the built in .NET stuff (which of course is only a wrapper for CDONTS). I got the "Could not access 'CDO.Message' object" error, with an innerException of “Could not connect to the underlying transport”.
Found this site on the internet that has some very usefull info. The solution to my problem was this
Old Code(cause the error):
SmtpMail.SmtpServer = “127.0.0.1“;
New Code(works 100%):
SmtpMail.SmtpServer.Insert(0,“127.0.0.1“);
'Insert' if of course the string method that inserts a string starting at a certain index. This was so weird that I checked out the dissasembly for the SmtpServer property, its a straight assign as in
_smtpServer = value;
none of the other methods in the class does any manipulation on the string. How weird is that !