If your account is too new (less than 1-2 month) forget about it, as soon as you dm around 10 people (could be less or more), you will be given a temporary label, and if you continue that behaviour for 3-4 days more, it will be eventually suspended permanently. And even if you stop, im not sure either if that label will go away at any point.
If you have aged accounts that are active, you wont have issues, as I was able to send same messages to random people that I had never interacted without any limits or issues. Maybe the typical one step arkose challenge, but that's about it.
If you are seeking to spam dms, id try to have some engagement first, and try talking with the people that engages with you before doing anything else.
Have to note that this all was done manually, so I cannot help if you are trying to automate that process.