<script language="vb" runat="server"> sub btnsendmail_onclick(source as object, e as eventargs) dim mymessage as new mailmessage dim mymail as new smtpmail dim stremail as string
if page.isvalid() then stremail = txtemail.text
mymessage.from = "[email protected]" & request.servervariables("server_name") mymessage.to = stremail mymessage.subject = "e-mail sample from asp 101!" mymessage.body = "this message was sent from sample code by " & _ "http://www.asp101.com. it is used to show people how " & _ "to send e-mail from an asp+ page. this mail was sent " & _ "from " & request.servervariables("server_name") & ". " & _ vbcrlf & vbcrlf & _ "this email was sent to " & stremail & "."
mymail.send(mymessage)
frmemail.visible = false lblusermessage.text = "your message has been sent to " & stremail & "." end if end sub </script>