2

I was doing a code for sending mails with the playbook and marmalade, this is my code

curl_easy_setopt(curl, CURLOPT_URL, "smtp://smtp.gmail.com:587");
    //curl_easy_setopt(curl, CURLOPT_PORT, this->_PORT);
    curl_easy_setopt(curl,CURLOPT_CONNECTTIMEOUT, 15);
    curl_easy_setopt(curl,CURLOPT_TIMEOUT, 30);
    curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL);
    curl_easy_setopt(curl, CURLOPT_USERNAME, "xxxxxxx@gmail.com");
    curl_easy_setopt(curl, CURLOPT_PASSWORD, "xxxxxxx");
    curl_easy_setopt(curl, CURLOPT_MAIL_FROM, this->_FROM);
    recipients = curl_slist_append(recipients, this->_TO);
    curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients);
    curl_easy_setopt(curl, CURLOPT_READFUNCTION, payload_source);
    curl_easy_setopt(curl, CURLOPT_READDATA, &upload_ctx);
    curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
    res = curl_easy_perform(curl);

It is the example from libcurl. (http://curl.haxx.se/libcurl/c/smtp-tls.html)

But everytime the curl_easy_perform executes i got the error CURLE_COULDNT_RESOLVE_HOST with every single address it does'nt matter if it is http,smtp, ftp, etc.

And if I put the IP instead of the name i always get Permission Denied.

I thing the error is the fake-ares.cpp and its asynchronous resolve.

I am using libcurl 7.21.7 and Marmalade 6.1

Can anyone help me? :/ or is there another way to send mail?

Thanks

Michael Donohue
  • 11,776
  • 5
  • 31
  • 44
Rudy_TM
  • 1,420
  • 4
  • 15
  • 27
  • Does http://curl.haxx.se/libcurl/c/simple.html work on your Playbook (just fetching a web page)? – Alexander Farber Jan 05 '13 at 10:57
  • Yes it works, I am using Marmalade, now I am having the problem in starting the SSL layer :/ I am using libcurl and openssl extensions for Marmalade. – Rudy_TM Jan 06 '13 at 23:42

0 Answers0