I am a complete newbie to ASP and am trying to send email from my gmail account to another gmail ID. Is it possible? I have my computer with no mail server installed. i have IIS installed and working. i have used the following code. I am getting the error..
CDO.Message.1 (0x80040213)
The transport failed to connect to the server.
the error is throwing at '.Send' line. the actual mail IDs given in from and to are real and existing ones... Please help me out..
Expand|Select|Wrap|Line Numbers
- <html>
- <head>
- <title>Mail send</title>
- <%
- sch = "http://schemas.microsoft.com/cdo/configuration/"
- Set cdoConfig = CreateObject("CDO.Configuration")
- With cdoConfig.Fields
- .Item(sch & "sendusing") = 2
- .Item(sch & "smtpserver") = "smtp.gmail.com"
- .update
- End With
- Set cdoMessage = CreateObject("CDO.Message")
- With cdoMessage
- Set .Configuration = cdoConfig
- .From = "myemail1@gmail.com"
- .To = "myemail2@gmail.com"
- .Subject = "Sample CDO Message"
- .TextBody = "This is a test for CDO.message"
- .Send
- End With
- Set cdoMessage = Nothing
- Set cdoConfig = Nothing
- %>
- </head>
- <body>
- </body>
- </html>