SMTP is a protocol that mail servers use to talk to anyone trying to send mail through them , its a challenge/response protocol as in HTTP, FTP etc , so its not actually a function.
To use PHP to do SMTP you need to use the socket functions or streams , which is not straightforward so I suggest you look for an existing SMTP script or class at somewhere like hotscripts.com or phpclasses.org.
There are some great SMTP scripts around but generally they are OOP (using classes) so look for one that provides examples if you are not used to that.
... the problem you are going to have is with ready-made scripts that probably utilise the mail() function (many forums for example) , so you will either need to hunt down all the mail() calls in those scripts and replace them , OR get software that already uses SMTP scripts instead of mail() (FUDforum , PHPbb etc)
....note one could
say to ones host that, this is thier problem not yours , there are ways of configuring sendmail or whatever mailserver they are using to stop spam at its source and look for spam like activities , some hosts will limit sendmail to $x mails per minute per user for example, personally I would be asking my host to track down & ban the abusers rather than let everyone else suffer .... but thats probably easier for me to say than for them to implement