Hi,
   I am using SMTP with libcurl to send out mail. What i wanted to know is
there some way we can attach a file to the mail using libcurl.
   The code looks like this:

        curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
         curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_ALL);
         curl_easy_setopt(curl,CURLOPT_READDATA, fd);
         curl_easy_setopt(curl,CURLOPT_URL,"smtp://smtp.gmail.com");
         curl_easy_setopt(curl,CURLOPT_MAIL_FROM, "<[email protected]
>");
         rcpt = curl_slist_append(rcpt,"<[email protected]>");
         curl_easy_setopt(curl,CURLOPT_MAIL_RCPT, rcpt);
         rcpt = curl_slist_append(rcpt,"<[email protected]>");
         curl_easy_setopt(curl,CURLOPT_MAIL_RCPT, rcpt);
         rcpt = curl_slist_append(rcpt,"<[email protected]>");
         curl_easy_setopt(curl,CURLOPT_MAIL_RCPT, rcpt);
         rcpt = curl_slist_append(rcpt,"<[email protected]>");
         curl_easy_setopt(curl,CURLOPT_MAIL_RCPT, rcpt);
         curl_easy_setopt(curl,CURLOPT_USERNAME, username);
         curl_easy_setopt(curl,CURLOPT_PASSWORD, password);

         res = curl_easy_perform (curl);
         printf("The return code is %d\n",res);
         curl_slist_free_all (rcpt);
         curl_easy_cleanup   (curl);

Thanks in advance.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to