There are lots of reasons to do bulk emailing besides spam. In my case I'm in a band and have a 2200+ person mailing list for news about tour dates, new albums, etc. that are all kids who signed up themselves. I hate all the spam I get and would never send email to people who didn't want it. (Ironically the reason I'm writing my own mailing list is because I've come up with some special features that actually let my mailing list members specify exactly what emails they want to get, to further cut down on unwanted information! =)
As for my problem, I think i found the solution. It seems that each reply from the SMTP server begins with a 3 digit code, a dash or a space, and then the message. As far as I can tell, a dash means that this message is not the last, and a space means it is, so I check for the space and stop the loop if i see one.
If you (or anyone) has any further information, or confirmation that this is the best way, please let me know.