/********* Sample code generated by the curl command line tool ********** * Lines with [REMARK] below might need to be modified to make this code * usable. Add error code checking where appropriate. * Compile this with a suitable header include path. Then link with * libcurl. * If you use any *_LARGE options, make sure your compiler figure * out the correct size for the curl_off_t variable. * Read the details for all curl_easy_setopt() options online on: * http://curlm.haxx.se/libcurl/c/curl_easy_setopt.html ************************************************************************/ #define _FILE_OFFSET_BITS 64 /* for pre libcurl 7.19.0 curl_off_t magic */ #include int main(int argc, char *argv[]) { CURLcode ret; CURL *hnd = curl_easy_init(); /* curl_easy_setopt(hnd, CURLOPT_WRITEDATA, 0xffbfe728); [REMARK] */ /* curl_easy_setopt(hnd, CURLOPT_WRITEFUNCTION, 0x15c10); [REMARK] */ /* curl_easy_setopt(hnd, CURLOPT_READDATA, 0xffbfe3d0); [REMARK] */ /* curl_easy_setopt(hnd, CURLOPT_READFUNCTION, 0x15ddc); [REMARK] */ /* curl_easy_setopt(hnd, CURLOPT_SEEKDATA, 0xffbfe3d0); [REMARK] */ /* curl_easy_setopt(hnd, CURLOPT_SEEKFUNCTION, 0x15d94); [REMARK] */ curl_easy_setopt(hnd, CURLOPT_INFILESIZE_LARGE, 14); curl_easy_setopt(hnd, CURLOPT_URL, "smtp://smtp.gmail.com:587/smtp%5Ftest%2Etxt"); curl_easy_setopt(hnd, CURLOPT_PROXY, NULL); curl_easy_setopt(hnd, CURLOPT_NOPROGRESS, 0); curl_easy_setopt(hnd, CURLOPT_HEADER, 0); curl_easy_setopt(hnd, CURLOPT_FAILONERROR, 0); curl_easy_setopt(hnd, CURLOPT_UPLOAD, 1); curl_easy_setopt(hnd, CURLOPT_DIRLISTONLY, 0); curl_easy_setopt(hnd, CURLOPT_APPEND, 0); curl_easy_setopt(hnd, CURLOPT_NETRC, 0); curl_easy_setopt(hnd, CURLOPT_FOLLOWLOCATION, 0); curl_easy_setopt(hnd, CURLOPT_UNRESTRICTED_AUTH, 0); curl_easy_setopt(hnd, CURLOPT_TRANSFERTEXT, 0); curl_easy_setopt(hnd, CURLOPT_USERPWD, "XXXXXXXXXX@gmail.com:XXXXXXX"); curl_easy_setopt(hnd, CURLOPT_PROXYUSERPWD, NULL); curl_easy_setopt(hnd, CURLOPT_NOPROXY, NULL); curl_easy_setopt(hnd, CURLOPT_RANGE, NULL); /* curl_easy_setopt(hnd, CURLOPT_ERRORBUFFER, 0xffbfe628); [REMARK] */ curl_easy_setopt(hnd, CURLOPT_TIMEOUT, 0); curl_easy_setopt(hnd, CURLOPT_REFERER, NULL); curl_easy_setopt(hnd, CURLOPT_AUTOREFERER, 0); curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/7.21.0 (sparc-sun-solaris2.9) libcurl/7.21.0 OpenSSL/0.9.8e zlib/1.1.3 libssh2/1.2.6"); curl_easy_setopt(hnd, CURLOPT_FTPPORT, NULL); curl_easy_setopt(hnd, CURLOPT_LOW_SPEED_LIMIT, 0); curl_easy_setopt(hnd, CURLOPT_LOW_SPEED_TIME, 0); curl_easy_setopt(hnd, CURLOPT_MAX_SEND_SPEED_LARGE, 0); curl_easy_setopt(hnd, CURLOPT_MAX_RECV_SPEED_LARGE, 0); curl_easy_setopt(hnd, CURLOPT_RESUME_FROM_LARGE, 0); curl_easy_setopt(hnd, CURLOPT_COOKIE, NULL); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, NULL); curl_easy_setopt(hnd, CURLOPT_SSLCERT, NULL); curl_easy_setopt(hnd, CURLOPT_SSLCERTTYPE, NULL); curl_easy_setopt(hnd, CURLOPT_SSLKEY, NULL); curl_easy_setopt(hnd, CURLOPT_SSLKEYTYPE, NULL); curl_easy_setopt(hnd, CURLOPT_KEYPASSWD, NULL); curl_easy_setopt(hnd, CURLOPT_SSH_PRIVATE_KEYFILE, NULL); curl_easy_setopt(hnd, CURLOPT_SSH_PUBLIC_KEYFILE, NULL); curl_easy_setopt(hnd, CURLOPT_SSH_HOST_PUBLIC_KEY_MD5, NULL); curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYHOST, 2); curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYPEER, 0); curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYHOST, 1); curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50); curl_easy_setopt(hnd, CURLOPT_CRLF, 0); curl_easy_setopt(hnd, CURLOPT_QUOTE, NULL); curl_easy_setopt(hnd, CURLOPT_POSTQUOTE, NULL); curl_easy_setopt(hnd, CURLOPT_PREQUOTE, NULL); curl_easy_setopt(hnd, CURLOPT_HEADERDATA, NULL); curl_easy_setopt(hnd, CURLOPT_COOKIEFILE, NULL); curl_easy_setopt(hnd, CURLOPT_COOKIESESSION, 0); curl_easy_setopt(hnd, CURLOPT_SSLVERSION, 0); curl_easy_setopt(hnd, CURLOPT_TIMECONDITION, 0); curl_easy_setopt(hnd, CURLOPT_TIMEVALUE, 0); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, NULL); /* curl_easy_setopt(hnd, CURLOPT_STDERR, 0x3d388); [REMARK] */ curl_easy_setopt(hnd, CURLOPT_HTTPPROXYTUNNEL, 0); curl_easy_setopt(hnd, CURLOPT_INTERFACE, NULL); curl_easy_setopt(hnd, CURLOPT_KRBLEVEL, NULL); curl_easy_setopt(hnd, CURLOPT_TELNETOPTIONS, NULL); curl_easy_setopt(hnd, CURLOPT_RANDOM_FILE, NULL); curl_easy_setopt(hnd, CURLOPT_EGDSOCKET, NULL); curl_easy_setopt(hnd, CURLOPT_CONNECTTIMEOUT, 0); /* curl_easy_setopt(hnd, CURLOPT_DEBUGFUNCTION, 0x163f0); [REMARK] */ /* curl_easy_setopt(hnd, CURLOPT_DEBUGDATA, 0xffbfe7d8); [REMARK] */ curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1); curl_easy_setopt(hnd, CURLOPT_ENCODING, NULL); curl_easy_setopt(hnd, CURLOPT_FTP_CREATE_MISSING_DIRS, 0); curl_easy_setopt(hnd, CURLOPT_IPRESOLVE, 0); curl_easy_setopt(hnd, CURLOPT_USE_SSL, 3); curl_easy_setopt(hnd, CURLOPT_FTP_ACCOUNT, NULL); curl_easy_setopt(hnd, CURLOPT_IGNORE_CONTENT_LENGTH, 0); curl_easy_setopt(hnd, CURLOPT_FTP_SKIP_PASV_IP, 0); curl_easy_setopt(hnd, CURLOPT_FTP_FILEMETHOD, 0); curl_easy_setopt(hnd, CURLOPT_FTP_ALTERNATIVE_TO_USER, NULL); curl_easy_setopt(hnd, CURLOPT_SSL_SESSIONID_CACHE, 1); /* curl_easy_setopt(hnd, CURLOPT_SOCKOPTFUNCTION, 0x131fc); [REMARK] */ /* curl_easy_setopt(hnd, CURLOPT_SOCKOPTDATA, 0xffbfe7d8); [REMARK] */ curl_easy_setopt(hnd, CURLOPT_POSTREDIR, 0); curl_easy_setopt(hnd, CURLOPT_MAIL_FROM, ""); /* curl_easy_setopt(hnd, CURLOPT_MAIL_RCPT, 0x3e620); [REMARK] */ ret = curl_easy_perform(hnd); curl_easy_cleanup(hnd); return (int)ret; } /**** End of sample code ****/