what is wrong "Name redefined"

Discussion in 'C#' started by alchemist, Dec 16, 2006.

  1. #1
    so I made a script acording template and when I run it I get the error message

    here is script:
    <%
    DIM strTitle, strFirstname, strLastName, strPatronymic, strPosition, strNameoftheinstitution, strCountry, strEmail, strPhone, strFax, strPresntationtitle, strSession, Mail
    strTitle=request.form("title")
    strFirstname=request.form("firstname")
    strLastName=request.form("lastname")
    strPatronymic=request.form("patronymic")
    strPosition=request.form("position")
    strNameoftheinstitution=request.form("institution")
    strCountry=request.form("country")
    strEmail=request.form("email")
    strPhone=request.form("phone")
    strFax=request.form("fax")
    strPresntationtitle=request.form("presentationtitle")
    strSession=request.form("session")
    
    DIM Mail, strMsgHeader
    Set Mail = Server.CreateObject("???????????")
    Mail.Host = "??????????"    
    Mail.From = strEmail
    Mail.AddAddress "????@tsu.ge"            
    Mail.AddCC "????@tsu.ge"
    Mail.Subject = "ICSP: Online Form"
    strMsgHeader = "????????????????????." & vbCrLf & vbCrLf
    Mail.Body=strMsgHeader & "email: " & strEmail & vbCrLf & _
    "First Name: " & strFirstName & vbCrLf & _
    "Last Name: " & strLastName & vbCrLf & _
    "Patronymic: " & strPatronymic & vbCrLf & _
    "Position: " & strPosition & vbCrLf & _
    "Name of the institution: " & strNameoftheinstitution & vbCrLf & _
    "Country: " & strCountry & vbCrLf & _
    "Email: " & strEmail & vbCrLf & _
    "Phone: " & strPhone & vbCrLf & _
    "Fax: " & strFax & vbCrLf & _
    "Session: " & strSession & vbCrLf & _
    "Presntationtitle: " & vbCrLf & strPresntationtitle
    On Error Resume Next
    Mail.Send
    Set Mail = Nothing
    IF Err <> 0 THEN
    Response.Write "There has been an error and your message could not be sent through email. Please try once again or try again later. " & Err.Description
    END IF
    %>
    
    <P>
    <%
    Response.Write strFirstName & ",<br>"
    Response.Write "Your message has been successfully sent." 
    %>,</P>
    
    Code (markup):
    and here is an error message:

    Error Type:
    Microsoft VBScript compilation (0x800A0411)
    Name redefined
    /test/send.asp, line 16, column 4
    DIM Mail, strMsgHeader
    ---^
    Code (markup):
    I can't understand what is wrong

    the line 16 is
    DIM Mail, strMsgHeader


    plz help :(
     
    alchemist, Dec 16, 2006 IP
  2. alchemist

    alchemist Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I made some changes, but now I get following error:
    Error Type:
    Microsoft VBScript runtime (0x800A01B6)
    Object doesn't support this property or method: 'Host'
    /test/send.asp, line 18
    Code (markup):
    what to do :(
     
    alchemist, Dec 17, 2006 IP
  3. pushkar

    pushkar Peon

    Messages:
    125
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    pushkar, Dec 17, 2006 IP
  4. Link.ezer.com

    Link.ezer.com Peon

    Messages:
    647
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    0
    #4
    maybe you are trying to use a kind of ASPemail
    but you forgot to use Server.CreateObject("Persits.MailSender")
    or you shall be able to find more ASP mail free code here: CDO, Jmail, Persits, SMTPsvg

    I hope the info helps you.
    Merry Christmas to all :)
     
    Link.ezer.com, Dec 18, 2006 IP
  5. phd

    phd Active Member

    Messages:
    496
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    60
    #5
    Change the variable name Mail to ContactMail or something else...

    The problem is with the variable "Mail"
     
    phd, Dec 22, 2006 IP