All you have to do is call the SendMail routine. In your codebehind, there are a few important elements. I'm sure there are multiple ways to do this, but this process always works for me.
In your codebehind...
'Set a few protected/public variables
Protected MsgSubject As String
Protected MsgBody As String
Public Attachment As String
Public SendMethod As String
Public SMTPServer As String = Convert.ToString(Common.Globals.HostSettings("SMTPServer"))
Public SMTPAuthentication As String = Convert.ToString(Common.Globals.HostSettings("SMTPAuthentication"))
Public SMTPUsername As String = Convert.ToString(Common.Globals.HostSettings("SMTPUsername"))
Public SMTPPassword As String = Convert.ToString(Common.Globals.HostSettings("SMTPPassword"))
'Create a subroutine to handle the mailing
Private Sub SendEmail()
Dim MsgText As String = ""
MsgText += "<table width=625>"
MsgText += "<tr>"
MsgText += "<td>Email Body Text Goes Here...</td>"
MsgText += "</tr>"
MsgText += "</table>"
'Email Routines
Dim OpenEmailFormatting As String
OpenEmailFormatting = ""
OpenEmailFormatting += "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">"
OpenEmailFormatting += "<HTML><HEAD><TITLE></TITLE>"
OpenEmailFormatting += "<META http-equiv=Content-Type content=""text/html; charset=iso-8859-1"">"
OpenEmailFormatting += "</HEAD><BODY>"
Dim CloseEmailFormatting As String
CloseEmailFormatting = "</BODY></HTML>"
'TO
MsgSubject = "Message Subject Goes Here..."
MsgBody = OpenEmailFormatting & MsgText & CloseEmailFormatting
Services.Mail.Mail.SendMail(UserInfo.Email, UserInfo.Email, "", "", Services.Mail.MailPriority.Normal, MsgSubject, Services.Mail.MailFormat.Html, System.Text.Encoding.UTF8, MsgBody, "", SMTPServer, SMTPAuthentication, SMTPUsername, SMTPPassword)
End Sub
All that's left is to actually call it. Where ever the event is that you want to fire the message (eg: onclick for a button) just call SendEmail().
Of course, you can do all kinds of message customization before or during the msgText portion so the message is personalized, context aware, etc.