-3

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

“/”应用程序中的服务器错误。

编译错误

说明:在编译服务此请求所需的资源期间发生错误。请查看以下特定错误详细信息并适当修改您的源代码。

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

源错误:

第 10 行:if Request("Send") <> "" Then 第 11 行:
第 12 行:设置 objMail = Server.CreateObject("Persits.MailSender") 第 13 行:
第 14 行:objMail.Host = strHost

源文件:E:\HostingSpaces\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> 
4

1 回答 1

1

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

于 2012-08-22T21:26:03.833 回答