Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <curl/curl.h>
- int main(void)
- {
- CURL* curl;
- CURLcode res = CURLE_OK;
- curl = curl_easy_init();
- if (curl) {
- struct curl_slist* recipients = NULL;
- curl_mime* mime;
- curl_mimepart* part;
- const char** cpp;
- curl_easy_setopt(curl, CURLOPT_URL, "smtp://smtp.live.com:587");
- curl_easy_setopt(curl, CURLOPT_USERNAME, "ime.prezime@hotmail.com");
- curl_easy_setopt(curl, CURLOPT_PASSWORD, "Sifra");
- recipients = curl_slist_append(recipients, "ime.prezime@hotmail.com");
- curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients);
- curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL);
- curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
- curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
- mime = curl_mime_init(curl);
- part = curl_mime_addpart(mime);
- curl_mime_filedata(part, "D:\\jebise.txt");
- curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime);
- for (long long int i = 15; 1; i++) {
- res = curl_easy_perform(curl);
- Sleep(3000);
- if (res != CURLE_OK)
- fprintf(stderr, "Nije poslato, error: %s\n", curl_easy_strerror(res));
- else
- fprintf(stderr, "%lld\n", i);
- }
- curl_slist_free_all(recipients);
- curl_easy_cleanup(curl);
- curl_mime_free(mime);
- }
- return (int)res;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement