curl-library
Problems sending mail about smtp
Date: Fri, 12 Nov 2010 09:23:29 +0800 (CST)
Hello
When I use smtp to send mail, there will be following the situation, before the use of no such situation, I think that not sending HELO to continue to the other。
This is the code I write, is there a mistake?
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_ALL);
curl_easy_setopt(curl, CURLOPT_URL, "smtp.gmail.com");
curl_easy_setopt(curl, CURLOPT_PORT, 25);
curl_easy_setopt(curl, CURLOPT_MAIL_FROM, "<********@gmail.com>");
slist = curl_slist_append(slist, "<*******@gmail.com>");
curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, slist);
curl_easy_setopt(curl, CURLOPT_USERNAME, "*******");
curl_easy_setopt(curl, CURLOPT_PASSWORD, "********");
curl_easy_setopt(curl, CURLOPT_READDATA, fp);
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_data);
* About to connect() to smtp.gmail.com port 25 (#0)
* Trying 74.125.127.109... * connected
* Connected to smtp.gmail.com (74.125.127.109) port 25 (#0)
* Server auth using Basic with user 'mulh0117'
> GET / HTTP/1.1
Authorization: Basic bXVsaDAxMTc6bWxoNjMzMDMwMA==
Host: smtp.gmail.com:25
Accept: */*
220 mx.google.com ESMTP w5sm469947ybe.10
502 5.5.1 Unrecognized command. w5sm469947ybe.10
* Connection #0 to host smtp.gmail.com left intact
* Closing connection #0
-- (Mu LinHai)
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-11-12