Discussion:
error using smtp with libcurl
Prasanna Mohanty
2010-08-24 23:43:53 UTC
Permalink
Hello,
I see the following error while trying to test smtp to send mail.
--
Local file size: 17 bytes.
* Protocol smtp not supported or disabled in libcurl
* Unsupported protocol
--
My overall program structure to set curl options look as follows.
Is there any thing missing in terms of setting any other option?

--
if(curl) {
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl,CURLOPT_URL, "smtp://10.207.80.101");
curl_easy_setopt(curl,CURLOPT_MAIL_FROM, "prasanna.mohanty<at>merson.com");
curl_easy_setopt(curl,CURLOPT_MAIL_RCPT, "prasanna.mohanty<at>emerson.com");

curl_easy_setopt(curl, CURLOPT_READDATA, hd_src);
curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE,
(curl_off_t)fsize);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
--
Thanks
Prasanna Mohanty
Jeff Pohlmeyer
2010-08-25 09:24:03 UTC
Permalink
On Tue, Aug 24, 2010 at 6:43 PM, Prasanna Mohanty wrote:

> I see the following error while trying to test smtp to send mail.
> --
> * Protocol smtp not supported or disabled in libcurl
> * Unsupported protocol

This means your libcurl was built without smtp support.

You should compile your libcurl with the configure option
--enable-smtp if you want it to support smtp.


- Jeff
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Prasanna Mohanty
2010-08-25 23:08:43 UTC
Permalink
I did the following inside curl-7.21.1 directory
--./configure --enable-smtpsudo make install
--From the command "curl --version" seems like my curl installation already supports smtpbut when I execute the compiled code I see the error. Did I miss any installation step? --
[***@localhost ~]$ curl --versioncurl 7.21.1 (i686-pc-linux-gnu) libcurl/7.21.1 OpenSSL/1.0.0 zlib/1.2.3 libidn/1.9Protocols: dict file ftp ftps http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp Features: IDN IPv6 Largefile NTLM SSL libz [***@localhost ~]$ ./a.outLocal file size: 17 bytes.* Protocol smtp not supported or disabled in libcurl* Unsupported protocol[***@localhost ~]$ --RegardsPrasanna Mohanty

> Date: Wed, 25 Aug 2010 04:24:03 -0500
> Subject: Re: error using smtp with libcurl
> From: ***@gmail.com
> To: curl-***@cool.haxx.se
>
> On Tue, Aug 24, 2010 at 6:43 PM, Prasanna Mohanty wrote:
>
> > I see the following error while trying to test smtp to send mail.
> > --
> > * Protocol smtp not supported or disabled in libcurl
> > * Unsupported protocol
>
> This means your libcurl was built without smtp support.
>
> You should compile your libcurl with the configure option
> --enable-smtp if you want it to support smtp.
>
>
> - Jeff
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
Corcoran, Jason
2010-08-25 23:32:11 UTC
Permalink
________________________________

From: curl-library-***@cool.haxx.se
[mailto:curl-library-***@cool.haxx.se] On Behalf Of Prasanna Mohanty
Sent: Wednesday, August 25, 2010 4:09 PM
To: curl-***@cool.haxx.se
Subject: RE: error using smtp with libcurl



I did the following inside curl-7.21.1 directory



--

./configure --enable-smtp

sudo make install
--

>From the command "curl --version" seems like my curl installation
already supports smtp

but when I execute the compiled code I see the error. Did I miss any
installation step?



--

[***@localhost ~]$ curl --version

curl 7.21.1 (i686-pc-linux-gnu) libcurl/7.21.1 OpenSSL/1.0.0 zlib/1.2.3
libidn/1.9

Protocols: dict file ftp ftps http https imap imaps ldap ldaps pop3
pop3s rtsp smtp smtps telnet tftp

Features: IDN IPv6 Largefile NTLM SSL libz

[***@localhost ~]$ ./a.out

Local file size: 17 bytes.

* Protocol smtp not supported or disabled in libcurl

* Unsupported protocol

[***@localhost ~]$

--

Regards

Prasanna Mohanty



can you do a where curl to ensure that your path is not causing you to
pick up a previously installed version of curl?





Jason.
Jeff Pohlmeyer
2010-08-25 23:36:26 UTC
Permalink
On Wed, Aug 25, 2010 at 6:08 PM, Prasanna Mohanty wrote:

> I did the following inside curl-7.21.1 directory
> --
> ./configure --enable-smtp
> sudo make install
> --
> From the command "curl --version" seems like my curl installation already
> supports smtp
> but when I execute the compiled code I see the error. Did I miss any
> installation step?
>
> --
> [***@localhost ~]$ curl --version
> curl 7.21.1 (i686-pc-linux-gnu) libcurl/7.21.1 OpenSSL/1.0.0 zlib/1.2.3
> libidn/1.9
> Protocols: dict file ftp ftps http https imap imaps ldap ldaps pop3 pop3s
> rtsp smtp smtps telnet tftp

> [***@localhost ~]$ ./a.out
> * Protocol smtp not supported or disabled in libcurl
> * Unsupported protocol



Please don't top-post on this list.

Is it possible the installed curl and your ./a.out are using two
different versions of the library?

Maybe try something like:

ldd ./a.out
ldd $(which curl)

And make sure you don't have an extra copy of the library
installed somewhere.


- Jeff
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Prasanna Mohanty
2010-08-26 18:54:14 UTC
Permalink
> Date: Wed, 25 Aug 2010 18:36:26 -0500
> Subject: Re: error using smtp with libcurl
> From: ***@gmail.com
> To: curl-***@cool.haxx.se
>
> On Wed, Aug 25, 2010 at 6:08 PM, Prasanna Mohanty wrote:
>
> > I did the following inside curl-7.21.1 directory
> > --
> > ./configure --enable-smtp
> > sudo make install
> > --
> > From the command "curl --version" seems like my curl installation already
> > supports smtp
> > but when I execute the compiled code I see the error. Did I miss any
> > installation step?
> >
> > --
> > [***@localhost ~]$ curl --version
> > curl 7.21.1 (i686-pc-linux-gnu) libcurl/7.21.1 OpenSSL/1.0.0 zlib/1.2.3
> > libidn/1.9
> > Protocols: dict file ftp ftps http https imap imaps ldap ldaps pop3 pop3s
> > rtsp smtp smtps telnet tftp
>
> > [***@localhost ~]$ ./a.out
> > * Protocol smtp not supported or disabled in libcurl
> > * Unsupported protocol
>
>
>
> Please don't top-post on this list.
>
> Is it possible the installed curl and your ./a.out are using two
> different versions of the library?
>
> Maybe try something like:
>
> ldd ./a.out
> ldd $(which curl)
>
> And make sure you don't have an extra copy of the library
> installed somewhere.
>
>
> - Jeff
Thanks for the suggestion.
In fact this was the problem ./a.out was picking the library from /usr/lib where as
the new lib is installed in /usr/local/lib. It is fixed.
Thanks
Prasanna Mohanty

> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
Loading...