Solved

CDO.Message.1 error '80040220'

Posted on 2004-10-08
5
302 Views
Last Modified: 2012-05-05
CDO.Message.1 error '80040220'

The "SendUsing" configuration value is invalid.

/scripts/subscribe.asp, line 52

We recently upgraded our ISP account and have to use CDO now with our suscribe.asp.
I have had some help but the script still isn't working.
I have read other help and it's almost as if my ISP has not given me the correct SMTP server name.
I have also received the '80070003' regarding can't find the path specified.
Are both these pointing to the fact that the SMTP server name is wrong?
Or is it something else?
Thank you,
-tlb

<%@LANGUAGE="VBSCRIPT"%>
<%
Const cdoSendUsingMethod                        =            "http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSendUsingPort                              = 2
Const cdoSMTPServer                                          =            "http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPort                              =            "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Const cdoSMTPConnectionTimeout      =            "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
Const cdoSMTPAuthenticate                        =            "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
Const cdoBasic                                                      = 1
Const cdoSendUserName                                    =            "http://schemas.microsoft.com/cdo/configuration/sendusername"
Const cdoSendPassword                                    =            "http://schemas.microsoft.com/cdo/configuration/sendpassword"

Dim Mailer
Dim iConf
Dim Flds

If Session("req_sent") <> "1" Then
      Set Mailer = Server.CreateObject("CDO.Message")
      Set iConf = Server.CreateObject("CDO.Configuration")
      
      Set Flds = iConf.Fields
      With Flds
            .Item(cdoSendUsingMethod)                        = cdoSendUsingPort
            .Item(cdoSMTPServer)                                    = "mail-fwd.com"
            .Item(cdoSMTPServerPort)                        = 25
            .Item(cdoSMTPconnectiontimeout) = 10
'            .Item(cdoSMTPAuthenticate)                  = cdoBasic
'            .Item(cdoSendUserName)                              = "USERNAME"
'            .Item(cdoSendPassword)                              = "PASSWORD"
            .Update
      End With

      Mailer.From = """" & Trim(Request.Form("FirstName")) & " " & Trim(Request.Form("LastName")) & """ <" & Trim(Request.Form("Email")) & ">"
      Mailer.Subject = "subscribe polb.com"
      Mailer.TextBody = "Tielines: " & Request.Form("Tielines") & VbCrLf & _
                                                            "Interchange: " & Request.Form("News_Bulletins") & VbCrLf & _
                                                            "re_port: " & Request.Form("re_port") & VbCrLf & _
                                                            "Annual Report: " & Request.Form("Annual_Report") & VbCrLf & _
                                                            "Fact Card: " & Request.Form("Fact_Card") & VbCrLf & _
                                                            "Port Directory: " & Request.Form("Economic_Impact") & VbCrLf & _
                                                            "Master Plan: " & Request.Form("Master_Plan") & VbCrLf & _
                                                            "Contact: " & Request.Form("LastName") & ", " & Request.Form("FirstName") & VbCrLf & _
                                                            "         " & Request.Form("Company") & VbCrLf & _
                                                            "         " & Request.Form("Address") & VbCrLf & _
                                                            "         " & "Suite " & Request.Form("Suite") & VbCrLf & _
                                                            "         " & Request.Form("City") & ", " & Request.Form("State") & " " & Request.Form("Zip") & VbCrLf & _
                                                            "         " & Request.Form("Country") & VbCrLf & _
                                                            "Email: " & Request.Form("Email")
      
      Mailer.To = """Webmaster"" <subscribe@polb.com>"

      Mailer.Send

      If Err.Number = 0 Then
            Session("req_sent") = "1"
            Response.Redirect("http://www.polb.com/html/1_about/thankyou.html")
      Else
            Session.Contents.Remove("req_sent")
            Response.Write("<meta http-equiv=""Refresh"" content=""20; url=" & Request.ServerVariables("HTTP_REFERER") & """><p>You must provide a valid email address.")
      End If
Else
      Response.Write("<meta http-equiv=""Refresh"" content=""20; url=" & Request.ServerVariables("HTTP_REFERER") & """><p>Please subscribe only once." & Session("mail_sent"))
End If

Set Mailer = Nothing
%>
0
Comment
Question by:DougAlbrecht
  • 2
5 Comments
 
LVL 6

Accepted Solution

by:
masirof earned 125 total points
ID: 12260979
0
 
LVL 20

Assisted Solution

by:jitganguly
jitganguly earned 125 total points
ID: 12260985
0
 
LVL 20

Expert Comment

by:jitganguly
ID: 12261001
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now