12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #include <stdio.h>
- #include <string.h>
- #include <curl/curl.h>
- int main(void)
- {
- CURL *curl;
- CURLcode res;
- struct curl_slist *recipients = NULL;
- curl = curl_easy_init();
- if(curl) {
-
- curl_easy_setopt(curl, CURLOPT_URL, "smtp://mail.example.com");
-
- recipients = curl_slist_append(recipients, "Friends");
- curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients);
-
- curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "EXPN");
-
- res = curl_easy_perform(curl);
-
- if(res != CURLE_OK)
- fprintf(stderr, "curl_easy_perform() failed: %s\n",
- curl_easy_strerror(res));
-
- curl_slist_free_all(recipients);
-
- curl_easy_cleanup(curl);
- }
- return 0;
- }
|