Gerrit,
first a virus can make use of mail client automation with the standard interface for it but they won't need that, they can run their own mail servers in the cloud that don't ask for the proper authentification. Their problem moves from the problem of sending mail via a proper mailserver to the protocols of forwarding mails between mail servers. I don't even know from the top of my hat how that is regulated. But it should be clear that posting a mail to your mailserver is like putting a letter into a mailbox and that just begins the journey to the destination mailserver, where the recipient can get its mails from.
It's indeed true that a virus also can include in itself a lot of things as a http, ftp or smtp server can be small sized implementations, but I guess a virus today is mostly a trojan that gets what it needs and loads it to your computer, if at all, in todays infrastructure they will have their army of servers in the cloud, your pc just becomes another client of these networks of malware and spam.
It's quite far fetched that a virus programmer would consult a programming forum to learn such things.
Chriss