我用MSXML2.ServerXMLHTTP类来做错误信息如下:Connecting to hotmail System.InvalidCastException: QueryInterface for interface MSXML2.IServerXMLHTTPR equest2 failed. at MSXML2.ServerXMLHTTPClass.open(String bstrMethod, String bstrUrl, Object v arAsync, Object bstrUser, Object bstrPassword) at HttpMail.MailClient.Connect(String username, String password) in d:\combre ad's document\visual studio projects\consoleapplication3\mailclient.cs:line 44 at HttpMail.EntryPoint.Main(String[] args) in d:\combread's document\visual s tudio projects\consoleapplication3\entrypoint.cs:line 38
[email protected]
System.InvalidCastException: QueryInterface for interface MSXML2.IServerXMLHTTPR
equest2 failed.
at MSXML2.ServerXMLHTTPClass.open(String bstrMethod, String bstrUrl, Object v
arAsync, Object bstrUser, Object bstrPassword)
at HttpMail.MailClient.Connect(String username, String password) in d:\combre
ad's document\visual studio projects\consoleapplication3\mailclient.cs:line 44
at HttpMail.EntryPoint.Main(String[] args) in d:\combread's document\visual s
tudio projects\consoleapplication3\entrypoint.cs:line 38
arAsync, Object bstrUser, Object bstrPassword)
你填入的参数是什么?源码中是
xmlHttp_.open("PROPFIND", serverUrl, false, username,
password);bstrUrl是否填"http://services.msn.com/svcs/hotmail/httpmail.asp"用户名,密码是否正确
发信过程中还要改几个参数,不然会有System.UnauthorizedAccessException: 拒绝访问
所以建议你把EntryPoint.cs改成窗口式的,好填入参数
string username = "";//修改
string password = "";//修改