I think you might need something like http://phpmailer.codeworxtech.com/index.php?pg=tutorial#2 - have also used blat in the past but PHP mailer seems to be what all the kids are using these days!