sending mail in asp

Discussion in 'ASP' started by rag84dec, Apr 3, 2008.

  1. rag84dec

    rag84dec New Member

    Joined:
    Jul 17, 2007
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    0
    Hi ,
    My simple code to send mail is this
    Code:
    
    <%
    sch = "http://schemas.microsoft.com/cdo/configuration/" 
     
        Set cdoConfig = CreateObject("CDO.Configuration") 
     
        With cdoConfig.Fields 
            .Item(sch & "sendusing") = 2 ' cdoSendUsingPort 
            .Item(sch & "smtpserver") = "<enter_mail.server_here>" 
            .update 
        End With 
     
        Set cdoMessage = CreateObject("CDO.Message") 
     
        With cdoMessage 
            Set .Configuration = cdoConfig 
            .From = "rag84dec@gmail.com" 
            .To = "rag84dec@gmail.com" 
            .Subject = "Sample CDO Message" 
            .TextBody = "This is a test for CDO.message" 
            .Send 
        End With 
     
        Set cdoMessage = Nothing 
        Set cdoConfig = Nothing 
    
    					
    					%>
    

    But it is giving me an error
    Code:
    Error Type:
    CDO.Message.1 (0x80040213)
    The transport failed to connect to the server. 
    /testmail.asp, line 21
    
    
    
    
    Can any one help me please
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice