Typically this exception has to deal with the following line of code (or I should say ABSENCE of the following line of code):
SmtpMail.SmtpServer = "mail.your-domain.com"
By default, if SmtpMail.SmtpServer is not set, System.Web.Mail is supposed to use localhost as the default property. However, for some reason this doesn't appear work. If you are using the local SMTP Service to send emails, you may try the following values:
"127.0.0.1"
"localhost"
"the_machine_name_here"
"the_real_dns_name_here"
"the_machine_IP_Address_here"
That should fix it.
The following information was sent to me by someone named "delonge". Some helpful information (they sent):
Wanted to provide some additional information regarding a topic you have listed on SMTP and the SendUsing parameter.
Issue: Number=-2147220502(0x800403EA) App [1002]
Source=CDO.Message.1
Description=
-2147220960[0x80040220]The "SendUsing" configuration value is invalid.
Additional Cause: The account running the code (usually a COM+ packaged component) which calls CDO (SMTP) does not have permissions to access the SendUsing configuration of the SMTP Metabase.
Additional Resolution: Run the adadd.vbs with the user account running the component code calling CDO.