why is this email not sending

--------------------------------------------------------------------------------

setting up the email to send email when a button is clicked

check it out, no errors but no email either


Code:
Private Sub CompRegConfirmation()

Dim msg As New MailMessage

msg.From = "localhost"

msg.To = "[email protected]"

msg.Subject = " Company registered"

msg.Body = txtUsername.Text

msg.BodyFormat = MailFormat.Html

SmtpMail.SmtpServer = "localhost"

SmtpMail.Send(msg)

End Sub


i call this then in a button click event
compregconfirmation()

no joy
__________________
im a newbie so be nice