# Using HTTP & SMTP libs together

**URL:** <https://forums.digi.com/t/using-http-smtp-libs-together/10369>\
**Category:** Rabbit\
**Created:** [August 17, 2009, 4:24pm UTC](https://forums.digi.com/t/using-http-smtp-libs-together/10369 "2009-08-17T16:24:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![unitron](https://avatars.discourse-cdn.com/v4/letter/u/48db29/32.png) [@unitron](https://forums.digi.com/u/unitron)\
**Post date:** [August 17, 2009, 4:24pm UTC](https://forums.digi.com/t/using-http-smtp-libs-together/10369/1 "2009-08-17T16:24:27Z")

</div>

Hello,

I have a simple program that is based around the following code -  
Sorry if i’ve got the syntax or function names slightly wrong, I’m writing this post from memory

–  
sock\_init();  
http\_init();  
tcp\_reserveport(80);

while(1){

## monitorInputs(); http\_handler(); }

The monitorInputs() function checks the status of some of the ports and attempts to send an email is the state has changed.

The general logic of the program runs ok, but it will only send an email if I comment out the http functions.

With the http functions enabled, as shown above, I just get an ‘Error opening socket.’ error with a -450 error number when it attempts to send an email.

Any help or insight would be appreciated.

Regards,  
Matt

---

<div class="post-metadata">

**Author:** ![kobuseng](https://avatars.discourse-cdn.com/v4/letter/k/f0a364/32.png) [@kobuseng](https://forums.digi.com/u/kobuseng)\
**Post date:** [August 18, 2009, 9:21am UTC](https://forums.digi.com/t/using-http-smtp-libs-together/10369/2 "2009-08-18T09:21:26Z")

</div>

I might be wrong but I have a strong suspicion you need to increase the amount of allowed sockets in your application. Usually done by :

#define MAX\_TCP\_SOCKET\_BUFFERS 2  
#define HTTP\_MAXSERVERS 2

---

<div class="post-metadata">

**Author:** ![unitron](https://avatars.discourse-cdn.com/v4/letter/u/48db29/32.png) [@unitron](https://forums.digi.com/u/unitron)\
**Post date:** [August 18, 2009, 10:33am UTC](https://forums.digi.com/t/using-http-smtp-libs-together/10369/3 "2009-08-18T10:33:48Z")

</div>

Thank you kobuseng!!,

It looks like that has cured my problem.
