Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 为什么赢了';这张ASP-EMAIL表格不会赢';不要发送电子邮件_Asp.net_Asp Classic - Fatal编程技术网

Asp.net 为什么赢了';这张ASP-EMAIL表格不会赢';不要发送电子邮件

Asp.net 为什么赢了';这张ASP-EMAIL表格不会赢';不要发送电子邮件,asp.net,asp-classic,Asp.net,Asp Classic,我最近得到帮助来修复我的ASP电子邮件脚本,但现在我在尝试从联系人表单发送电子邮件时遇到了这个编译错误。。脚本位于错误消息下方 “/”应用程序中出现服务器错误 编译错误 描述:编译服务此请求所需的资源时出错。请查看以下特定错误详细信息,并适当修改源代码 编译器错误消息:BC30807:不再支持“Let”和“Set”赋值语句 源错误: 第10行:如果请求(“发送”),则 第11行: 第12行:设置objMail=Server.CreateObject(“perits.mailssender”) 第

我最近得到帮助来修复我的ASP电子邮件脚本,但现在我在尝试从联系人表单发送电子邮件时遇到了这个编译错误。。脚本位于错误消息下方

“/”应用程序中出现服务器错误

编译错误

描述:编译服务此请求所需的资源时出错。请查看以下特定错误详细信息,并适当修改源代码

编译器错误消息:BC30807:不再支持“Let”和“Set”赋值语句

源错误:

第10行:如果请求(“发送”),则 第11行:
第12行:设置objMail=Server.CreateObject(“perits.mailssender”) 第13行:
第14行:objMail.Host=strHost

源文件:E:\hostingspace\dma\myuniversalcare.com\wwwroot\contact-us\Default.aspx行:12

以下是脚本:

<% 
    Session.CodePage = 65001 

Dim strHost, objMail, strToAddress, txtMsg 

    ' Change this to your own SMTP server 
    strHost = "localhost" 

    if Request("Send") <> "" Then 

        Set objMail = Server.CreateObject("Persits.MailSender") 

        objMail.Host = strHost 

        objMail.From = "info@persits.com"           ' From address 
        objMail.FromName = "AspEmail Live Demo"     ' optional 

        strToAddress = Trim(Request("txtTo")) 

        ' To prevent header injection attack 
        strToAddress = Replace( strToAddress, " ", "" ) 
        strToAddress = Replace( strToAddress, chr(13), "" ) 
        strToAddress = Replace( strToAddress, chr(10), "" ) 

        ' To address, 2nd argument omitted. 
        objMail.AddAddress strToAddress 

        ' Message subject 
        objMail.Subject = objMail.EncodeHeader( Request("txtSubject"), "UTF-8" ) 

        ' Enable Unicode 
        objMail.ContentTransferEncoding = "Quoted-Printable" 
        objMail.CharSet = "UTF-8" 

        ' Message body 
        objMail.Body = Request("txtBody") 

        ' Include a disclaimer 
        objMail.Body = objMail.Body & chr(13) & chr(10) & chr(13) & chr(10) & "-----------------------------------" & chr(13) & chr(10) & chr(13) & chr(10) & "This message was generated by the AspEmail live demo on-line application. Persits Software, Inc. is not responsible for its content." 

        On Error Resume Next 
        objMail.Send ' Send message 

        If Err = 0 then      
            txtMsg = "<font color=green>Success! Message sent to " & strToAddress + ".</font>" 
        Else         
            txtMsg = "<font color=red>Error occurred: " + err.Description + "</font>" 
        End If 

    End If 
%> 

<HTML> 
<HEAD> 

<META HTTP-EQUIV="Content-Type" content="text/html; charset=utf-8"> 

<TITLE>AspEmail Live Demo: Unicode-enabled Message Sending</TITLE> 
</HEAD> 
<BODY style="font-family: arial narrow; font-size: 10pt"> 

<h2>AspEmail Live Demo: Unicode-enabled Message Sending</h2> 

<P>  


<FORM METHOD="POST" ACTION="demo_simple.asp"> 

<TABLE CELLSPACING=2 CELLPADDING=2 BGCOLOR="#E0E0E0" style="border: 1pt black solid; border-collapse: collapse"> 
    <TR> 
        <TD>To:</TD> 
        <TD><INPUT TYPE="TEXT" size="40" NAME="txtTo" VALUE="<% = Server.HtmlEncode(Request("txtTo")) %>"></TD> 
    </TR> 
    <TR> 
        <TD>Subject:</TD> 
        <TD><INPUT TYPE="TEXT" size="40" NAME="txtSubject" VALUE="<% = Server.HtmlEncode(Request("txtSubject")) %>"></TD> 
    </TR> 
    <TR> 
        <TD valign="top">Body:</TD> 
        <TD><TEXTAREA NAME="txtBody" Rows="10" Cols="40"><% = Server.HtmlEncode(Request("txtBody")) %></TEXTAREA></TD> 
    </TR> 
    <TR> 
        <TD COLSPAN=2><INPUT TYPE="SUBMIT" NAME="Send" VALUE="Send Message"></TD> 
    </TR> 

</TABLE> 

<P> 

<% = txtMsg %> 

</FORM> 

</BODY> 
</HTML> 

AspEmail Live演示:启用Unicode的邮件发送
AspEmail Live演示:启用Unicode的邮件发送

致: 主题: 正文:


如果您使用的是aspx,则不能使用set。您在aspx页面中有一个ASP代码。

为什么要将其标记为c#和ASP.net?这是典型的ASP,与ASP.net不同,与Java服务器页面不同。