We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now


Why I have asp name redefined?

Medium Priority
Last Modified: 2012-05-06
hi Experts!

I looking for the error in this code, but I don´t find the error. The error is:

Error Type:
Microsoft VBScript compilation (0x800A0411)
Name redefined
webContact/sendEmail.asp, line 29, col 16
Public Function sendEmail(emailTo, emailFrom, emailSubject, emailBody)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
    Dim sendEmail
    Dim destinatario
    Dim nombre
    Dim asunto
    Dim email
    Dim telefono
    Dim direccion
    Dim cp
    Dim localidad        
    Dim estado
    Dim comentario        
    Dim textBody
    'Dim destinatarios(7)
    Dim destinatarios(8)
    'Realiza el envío del correo electrónico
    'emailTo      Destinatario, email
    'emailFrom    Emisor, email
    'emailSubject Asunto, email
    'emailBody    Mensaje, email
    'Sets sendEmail variable
    Public Function sendEmail(emailTo, emailFrom, emailSubject, emailBody)
        sendEmail                = false
        Const cdoSendUsingPickup = 1                            'Send message using the local SMTP service pickup directory.
        Const cdoSendUsingPort   = 2                            'Send the message using the network (SMTP over the network). 
        Const cdoAnonymous       = 0                            'Do not authenticate
        Const cdoBasic           = 1                            'basic (clear-text) authentication
        Const cdoNTLM            = 2                            'NTLM
        Const smtpSendUsing      = 1                            '1=local, 2=remote
        Const smtpServer         = "mail.grupocti.com"
        Const smtpPort           = 25
        Const smtpUN             = "jmorquecho"
        Const smtpPW             = "cti011107"
        Const UseSSL             = False
        Const smtpTimeout        = 10
        Dim email
        Set email = server.CreateObject("CDO.Message")
        With email.Configuration.Fields
            .Item("http://schemas.microsoft.com/cdo/configuration/sendusing")               = smtpSendUsing
            .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")              = smtpserver
            .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")          = smtpport
            .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")        = cdoBasic
            .Item("http://schemas.microsoft.com/cdo/configuration/sendusername")            = smtpUN
            .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword")            = smtpPW
            .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl")              = UseSSL
            .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")   = smtpTimeout
        End With
        With email
            .Subjec   = emailSubject
            .From     = emailFrom
            .To       = emailTo
            .TextBody = emailBody
            if err=0 then sendEmail=true
        End With 
        Set email=Nothing
    End Function
    'Verifica que el captcha allá sido introducido correctamente
    '@params valCAPTCHA Valor del captcha establecido previamente
    '@Sets CheckCAPTCHA variable
    Function CheckCAPTCHA(valCAPTCHA)
	    SessionCAPTCHA = Trim(Session("CAPTCHA"))
	    Session("CAPTCHA") = vbNullString
	    If Len(SessionCAPTCHA) < 1 then
            CheckCAPTCHA = False
            exit function
        End If
	    If CStr(SessionCAPTCHA) = CStr(valCAPTCHA) then
	        CheckCAPTCHA = True
	        CheckCAPTCHA = False
	    End If
    End Function
	strCAPTCHA = Trim(Request.Form("strCAPTCHA"))
	If CheckCAPTCHA(strCAPTCHA) = True Then
        destinatarios(1) = "ventas@grupocti.com"
        destinatarios(2) = "dirgeneral@grupocti.com"
        destinatarios(3) = "dirconsultoria@grupocti.com"
        destinatarios(4) = "aclientes@grupocti.com"
        destinatarios(5) = "mesadecontrol@grupocti.com"
        destinatarios(6) = "webmaster@grupocti.com"
        destinatarios(7) = "javiermorquecho@msn.com"
        destinatario     = Request.Form("destinatario")
        nombre           = Request.Form("nombre")    
        asunto           = Request.Form("asunto")
        email            = Request.Form("email")    
        telefono         = Request.Form("telefono")
        direccion        = Request.Form("direccion")    
        cp               = Request.Form("cp")
        localidad        = Request.Form("localidad")    
        estado           = Request.Form("estado")    
        comentario       = Request.Form("comentario")
        textBody         = "Persona emisora:"            & "/n/n" & _
                            "Nombre: "      & nombre     & "/n"   & _
                            "Asunto: "      & asunto     & "/n"   & _
                            "Email: "       & email      & "/n"   & _
                            "Teléfono : "   & telefono   & "/n"   & _
                            "Dirección : "  & direccion  & "/n"   & _
                            "CP : "         & cp         & "/n"   & _
                            "Localidad : "  & localidad  & "/n"   & _
                            "Estado : "     & estado     & "/n"   & _
                            "Comentario : "              & "/n/n" & comentario
        emailDestino     = destinatarios(destinatario)
        sendEmail emailDestino, "webinfo@grupocti.com", "mensaje de usuarios en página web", textBody
        If !sendEmail Then
            msg = "No se puedo enviar el email. Por favor, intente más tarde."
            Response.Write("<" & "script language=VBScript>")
            Response.Write("MsgBox """ & msg & """<" & "/script>")
            <!-- Confirmación de envío -->
            <div style='text-align: center;'><img style='width: 663px; height: 84px;' alt='logo de CTI' src='../Images/logo12.png'><br>
                <span style='font-family: Arial'>
            Hemos recibido su petici&oacute;n, a la brevedad nos pondremos en contacto con Ud.<br>
        End If
    End If

Open in new window

Watch Question

Technology and Business Process Advisor
Most Valuable Expert 2013
Hello javiermorquecho,

Don't use Dim sendEmail as the first ASP line.  You don't need to dimension a function.



Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


OK Thnx a lot!!!!!!

This error means that you have attempted declared a variable (eg dim sendEmail) twice.


Yes Wikkard!

Ufortunatelly, I haven´t point to you....

Thnx anyway!

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.