asp表单问题
我有这个表单
<form action="http://www.mysite.com/asp/formd.asp" method="post" target="_blank">
,所以 asp 如下所示,
它打开一个新窗口,其中 ot 说“发送确定”
我的问题是如何以及在哪里可以控制/定义这个新窗口的样式,即背景字体颜色等 感谢
ASP 代码:
<%@ Language=VBScript %>
<%
Dim txtbody
Dim objCDO
Set objCDO = Server.CreateObject("CDONTS.NewMail")
objCDO.To = "[email protected]"
objCDO.From = "[email protected]"
objCDO.Subject = "* *Formu enviado desde web * *"
txtbody = ""
for a = 1 to Request.Form.Count
txtbody = txtbody & Request.Form.Key(a) & " = " & Request.Form(a) & chr(10) & chr(13)
next
for a = 1 to Request.QueryString.Count
txtbody = txtbody & Request.QueryString.Key(a) & " = " & Request.QueryString(a) & chr(10) & chr(13)
next
txtbody = txtbody & "*******-----------------******"
objCDO.Body = txtbody
objCDO.Send
Response.Write "send = Ok"
%>
I have this form
<form action="http://www.mysite.com/asp/formd.asp" method="post" target="_blank">
so the asp looks like below,
it opens a new window where ot says "send ok"
my question is how and where can I contro/define the style of this new window i.e background fonts color etc
thanks
the ASP code:
<%@ Language=VBScript %>
<%
Dim txtbody
Dim objCDO
Set objCDO = Server.CreateObject("CDONTS.NewMail")
objCDO.To = "[email protected]"
objCDO.From = "[email protected]"
objCDO.Subject = "* *Formu enviado desde web * *"
txtbody = ""
for a = 1 to Request.Form.Count
txtbody = txtbody & Request.Form.Key(a) & " = " & Request.Form(a) & chr(10) & chr(13)
next
for a = 1 to Request.QueryString.Count
txtbody = txtbody & Request.QueryString.Key(a) & " = " & Request.QueryString(a) & chr(10) & chr(13)
next
txtbody = txtbody & "*******-----------------******"
objCDO.Body = txtbody
objCDO.Send
Response.Write "send = Ok"
%>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您想要一个更有意义的页面或消息,请考虑将其替换
为:
然后让您的新页面
email-thank-you.htm
尽可能漂亮地装饰和样式。这有助于将电子邮件逻辑包含在一个页面或函数中,并与漂亮的页面分开。如果发生了某些情况,即电子邮件服务器不可用,或者电子邮件地址格式错误/丢失,您可以将其写回原始页面。If you'd like to have a page or message that's more meaningful, consider replacing this
with this:
Then go make your new page
email-thank-you.htm
as decorated and styled as nicely as you can. This helps by having your email logic contained in one page or function, and separate from the nice page. If something happened, i.e. the email server was unavailable, or perhaps the email address was malformed/missing, you could write that back to the original page.如果我正确理解您所做的事情,您实际上应该创建一个名为 emailForm.asp 的静态表单,并使用您想要的样式。让它读取您传递的查询字符串并将值放入字段中。在当前页面上放置链接以弹出此页面。
If I understand what you're doing correctly, you should actually create a static form called emailForm.asp with your desired styling. Have it read the querystring that you are passing and and place the values in the fields. Put on link on your current page in order to pop this page up.
您的最后一行
Response.Write "send = Ok
" 将作为格式错误的 html 页面输出。我建议您按如下方式构建页面:
这将呈现一个完整的 html 页面,您可以正确设置样式(并且也不会假定电子邮件发送正常!)。
Your final line,
Response.Write "send = Ok
" is being output as a badly-formed html page.I'd recommend you structure your page as follows:
This will render a full html page that you can style properly (and will also no presume that the email sent OK!).