Skip to main content

Posts

Showing posts with the label How to send gmail from libcurl

SMTP Libcurl

Hi , Libcurl is a utility tool which we can also send e-mails using SMTP library. Below is a sample program which helps you to do the same from Linux-C Language. Below is the program ================ #include <stdio.h> #include <string.h> #include <curl/curl.h> int main(void) {   CURL *curl;   CURLcode res;   FILE *FP;   struct curl_slist *recipients = NULL;   static const char *from = "********@gmail.com";   static const char *to = "********@gmail.com";   FP=fopen("/tmp/Email","r");   curl = curl_easy_init();   if(curl) {     curl_easy_setopt(curl, CURLOPT_URL, "smtp://smtp.gmail.com:587");     curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_ALL);     curl_easy_setopt(curl, CURLOPT_USERNAME, "From_Email_User@gmail.com");     curl_easy_setopt(curl, CURLOPT_PASSWORD, "*********");     curl_easy_setopt(curl, CURLOPT_MAIL_FROM, from...