Settxfee does not work in RPC I am using settxfee(0.00020) before sendtoaddress RPC call however after sending 0.042 in blockchain a fee of 0.000045 is showing.

How can I set the fee properly ?

Thanks
settxfee sets the transaction fee per kilobyte, as that is the relevant unit for prioritization on the network and in blocks.

With sendtoaddress the size (in bytes) is not known ahead of time, so you can't set the exact fee.