使用libcurl发送电子邮件在Exchange服务器上失败 我试图在C++交换服务器上使用LIbCURL发送一个简单的电子邮件消息。程序似乎与服务器连接,正确验证,但在尝试发送包时失败,错误为500-未知命令

使用libcurl发送电子邮件在Exchange服务器上失败 我试图在C++交换服务器上使用LIbCURL发送一个简单的电子邮件消息。程序似乎与服务器连接,正确验证,但在尝试发送包时失败,错误为500-未知命令,c++,email,curl,exchange-server,libcurl,C++,Email,Curl,Exchange Server,Libcurl,我已经验证了服务器地址,libcurl是用SSL支持编译的,NTLM是受支持的身份验证类型,所有电子邮件地址都是有效的 检查CURL版本将返回: curl 7.37.1 (armv5tejl-unknown-linux-gnueabi) libcurl/7.37.1 OpenSSL/0.9.8o zlib/1.2.3.4 Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smtp smtps te

我已经验证了服务器地址,libcurl是用SSL支持编译的,NTLM是受支持的身份验证类型,所有电子邮件地址都是有效的

检查CURL版本将返回:

curl 7.37.1 (armv5tejl-unknown-linux-gnueabi) libcurl/7.37.1 OpenSSL/0.9.8o zlib/1.2.3.4
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: IPv6 Largefile NTLM NTLM_WB SSL libz
该计划报告如下:

* Rebuilt URL to: mail.domain.net:587/
* Hostname was NOT found in DNS cache
*   Trying 192.168.0.114...
* Connected to mail.domain.net (192.168.0.114) port 587 (#0)
* Server auth using NTLM with user 'redmine'
> PUT / HTTP/1.1
Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
Host: mail.iem.net:587
Accept: */*
Content-Length: 0

220 mail.domain.net Microsoft ESMTP MAIL Service ready at Fri, 22 Aug 2014 15:20:09 -0400
500 5.3.3 Unrecognized command
500 5.3.3 Unrecognized command
500 5.3.3 Unrecognized command
500 5.3.3 Unrecognized command
500 5.3.3 Unrecognized command
421 4.7.0 Too many errors on this connection, closing transmission channel
* Connection #0 to host mail.iem.net left intact
我正在程序中使用以下连接设置:

curl_easy_setopt(this->curl,CURLOPT_URL, this->address.c_str());
curl_easy_setopt(this->curl,CURLOPT_USERNAME,this->username.c_str());
curl_easy_setopt(this->curl,CURLOPT_PASSWORD,this->username.c_str());
curl_easy_setopt(this->curl,CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_easy_setopt(this->curl,CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
curl_easy_setopt(this->curl,CURLOPT_USE_SSL, CURLUSESSL_ALL);
curl_easy_setopt(this->curl,CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(this->curl,CURLOPT_SSL_VERIFYHOST, 0L);
curl_easy_setopt(this->curl,CURLOPT_UPLOAD, 1L);
curl_easy_setopt(this->curl, CURLOPT_VERBOSE, 1L);  

如有任何建议,将不胜感激

我想有人会为此刺伤我,但你知道获得libcurl帮助的最好地方是curl库邮件列表,对吗?它不是在stackoverflow上…如果您正在向SMTP服务器发送HTTP请求,您将度过一段不愉快的时光。你应该使用像
smtp://mail.domain.net:587
使用smtp://协议指示符会导致MS Exchange的身份验证问题。我不完全清楚原因。我尝试使用邮件列表,但没有任何效果:(