Bot connects, receives messages, but can't send messages

To send a message to a channel you only have to send PRIVMSG <channel> :message. You need the colon before the message because it denotes the trailing of the message, which can contain spaces. With a prefix (which you don’t need for sending) you’d also need a leading colon (:name!name@name PRIVMSG ..) to indicate that the first word is a prefix and not a command.

(I omitted the \r\n that has to be at the end of every command, which already correctly is in your code.)