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>
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>