a form to email

G

Guest

i want to know how can i get the form information with mailbody ? am i doing
wrong with "objMail.Body =......" ? please help!
here it is :
<%@ Import Namespace="System.Web.Mail" %>
<Script Language="VB" Runat="Server">
Sub Send(sender As Object, e As EventArgs)
Dim objMail As New MailMessage()
objMail.From = FromWho.Text & "<" & FromMail.Text & ">"
objMail.To = "(e-mail address removed)"
objMail.BodyFormat = MailFormat.Text
objMail.BodyEncoding = Encoding.ASCII
objMail.Subject = "Order"
objMail.Body =request.Form("tform""'FromWho','FromMail','tel','address'")

SmtpMail.SmtpServer = "mail.server.com"
SmtpMail.Send(objMail)
Response.Redirect("abc.htm")
End Sub
</Script>
<Html>
<Head>
<Title>Tester</Title>
</Head>
<Body>

<Form Runat="Server" id=tform>
Namer : <Asp:TextBox Runat="Server" Id="FromWho" Columns="7" /> <br>
Email Address : <Asp:TextBox Runat="Server" Id="FromMail" Columns="20" /><br>
Tel : <Asp:TextBox Runat="Server" Id="tel" Columns="8" /><br>
Address : <Asp:TextBox Runat="Server" Id="address" Columns="20" /><br>


<Asp:Button Runat="Server" OnClick="Send" text="Send" />
</Center>
</Form>


</Body>
</Html>
 
R

Ross Presser

i want to know how can i get the form information with mailbody ? am i doing
wrong with "objMail.Body =......" ? please help! ....
objMail.Body =request.Form("tform""'FromWho','FromMail','tel','address'")

request.Form doesn't work that way... try

objMail.Body = FromWho.Text & vbCrLf & FromMail.Text & vbCrLf _
& tel.Text & vbCrLf & address.Text
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top