Solved

CDO.Message.1 error '80040220'

Posted on 2004-10-08
5
303 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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

20 Experts available now in Live!

Get 1:1 Help Now