According to the help file, your usage of the -n switch with the /raw command is the correct method.

I don't know if this was a typo or not, but I did notice that the /raw command you posted appeared to be missing a parameter.

You posted /raw -n PRIVMSG :<msg>
When I believe it should be /raw -n PRIVMSG <nickname> :<message>

As you can see, the line you posted is missing the <nickname> parameter.