I tried using -zeroconfspend=1 but it didin't work either. Do you guys know what im doing wrong?
AFAIK, there is no
-zeroconfspend option... the only option similar to this for Bitcoin Core is
-spendzeroconfchange, but that is for change outputs... not UTXOs from "incoming" transactions.
The problem is that the
sendtoaddress API option will only work with confirmed coins (or your unconfirmed change). Basically, the UTXOs that you can see using
listunspent command (with default options)... and if those aren't available, then only unconfirmed UTXOs that we created and are then "trusted". If you want to send unconfirmed coins that were not created by your wallet, you'll need to manually create, sign and send a "raw" transaction.
Refer:
https://github.com/bitcoin/bitcoin/issues/3288#issuecomment-28939903