Go4Expert

Go4Expert (http://www.go4expert.com/)
-   ASP (http://www.go4expert.com/forums/asp/)
-   -   sending mail in asp (http://www.go4expert.com/forums/sending-mail-asp-t9736/)

rag84dec 3Apr2008 14:32

sending mail in asp
 
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


All times are GMT +5.5. The time now is 15:50.