No can do! You'd have to quit YM just to send that quick SMS and then sign back in again. Any messages that are sent during the time offline is received as offline messages which are received once you sign in. What a bother, but I guess another key reason for not having true multitasking available is because of the crap battery life of the iPhone (my other iPhone pet peeve) and that IM networks, like YM and MSN are not specific for the iPhone so it can't take advantage of the Push notification made available by the iPhone OS 3.0.
That's where a new iPhone-to-iPhone IM tool called Ping! comes in and gets it right.
What makes this app different from the other iPhone messaging apps is that it is specific for the iPhone and uses Push notification to inform the recipient when a message is received, even if Ping! is not running.
So now, with Ping!, users can now send message to their other iPhone-wielding friends without using SMS. This is obviously great savings if both users are on data service packages with ample data quota and also as an alternative to sending international SMSes, which tend to cost much more than their local cousins.
This is similar to the service that Blackberry Messenger makes available for all Blackberry users. But I guess the biggest difference is that while I would trust a company like RIM with the privacy of my conversations and email, I am not so sure about this Gary Fung chap who developed Ping! So while I would still use this app to have simple conversations with friends, I'd avoid discussing national secrets with this app.
Ping! still lacks a lot of key features that you'd expect out of an IM application, like proper friends list management and blocking, but it's still a great first step. I still think that some of the privacy concerns need to be addressed first before this can hit critical mass though.
UPDATE 1: Ping! is no longer free... But you can get the full version for just $0.99 or Ping! Lite for FREE. Take note though that Ping! Lite is ad sponsored.
UPDATE 2: There have also been many reports from people I know using Ping! that messages somethings comes in delayed (sometimes up to a day) or never gets delivered at all. The developer has responded that the messages have been sent to the Apple push servers for delivery, and might have gotten lost or says that the network that I and my friends are using is slow. This has happened a bit too often to be an isolated occurrence so I am guessing that it might be a load scaling problem due to the increased volume of users on the application now. In any case, reliability is still suspect so if you really need to get the message across to your intended recipient, stick to SMS. If you just want to have a casual chat, you can try using Ping!, just don't blame your friends if they don't reply immediately...
RECOMMENDED (until something better comes along... Which I will review when it does!)