#1
  1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Dec 2004
    Posts
    16
    Rep Power
    0

    CDO.Message.1 error '80040220'


    Hey there... newbie needs some help.

    I have the following script loaded on a Windows 2003 server.
    (Trying to migrate code from CDONTS to CDOSYS)
    Code:
    <%
    Dim MyMail
    Set MyMail = CreateObject("CDO.Message")
    MyMail.From = "address@domain.com"
    MyMail.To = "emailaddress@domain.com"
    MyMail.Subject = "Test message using CDOSYS"
    MyMail.TextBody ="This is a test email message" & vbcrlf & "sent with CDOSYS"
    MyMail.Send
    Set MyMail= nothing
    Response.Write("Your e-mail has been sent")
    %>
    I am getting an error of:
    CDO.Message.1error '80040220'
    The "SendUsing" configuration value is invalid.
    /site_build/cdosys.asp, line 8
    Any ideas anyone? Much appreciated!
  2. #2
  3. Couch Potato Wizard
    ASP Mastermind (5000+ posts)

    Join Date
    Jan 2005
    Location
    India
    Posts
    13,652
    Rep Power
    2685
    hi JAM
    i am not sure of the error....... u can try searching it in search engines like google!

    i have a code which i use for MS XP and localhost using CDOSYS.
    may b it gives u any ideas(i too found this code on internet).

    <%
    Dim objMail, objMailConf
    Set objMail = Server.CreateObject("CDO.Message")
    Set objMailConf = Server.CreateObject("CDO.Configuration")
    objMailConf.Fields.item("http://schemas.microsoft.com/cdo/con...tion/sendusing") = 1
    objMailConf.Fields.item("http://schemas.microsoft.com/cdo/con...ickupdirectory") = "c:\inetpub\mailroot\pickup"
    objMailConf.Fields.item("http://schemas.microsoft.com/cdo/con...ion/smtpserver") = "http://localhost"
    objMailConf.fields.Item("http://schemas.microsoft.com/cdo/con...smtpserverport") = 25
    objMailConf.Fields.item("http://schemas.microsoft.com/cdo/con...nectiontimeout") = 10
    objMailConf.Fields.Update
    Set objMail.Configuration = objMailConf
    objMail.From = "from@yahoo.com"
    objMail.To = "to@yahoo.com"

    objMail.Subject = "Mail using CDO"
    objMail.TextBody = "Hi "

    objMail.Fields.Update
    objMail.Send
    Set objMail = Nothing
    %>

    hope it helps in any way!
    micky

    __________________________________________________ __________________________________
    my website www.pcmantra.com
  4. #3
  5. Alter Ego Wizard
    ASP Genius (4000 - 4499 posts)

    Join Date
    Jun 2004
    Location
    Edinburg Tx
    Posts
    4,401
    Rep Power
    1657
    ................... ASCII and ye shall receive ..................
    Knowledge is the only resource on earth that multiplies when shared


    Support the Shemzilla Project
    Powered by C#
  6. #4
  7. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Dec 2004
    Posts
    16
    Rep Power
    0
    Thanks to you both. I've tried both examples that you've given me and none of them will work for me.

    Code:
    <% 
    	sch = "http://schemas.microsoft.com/cdo/configuration/" 
    	Set cdoConfig = Server.CreateObject("CDO.Configuration") 
    	cdoConfig.Fields.Item(sch & "sendusing") = 2 
    	cdoConfig.Fields.Item(sch & "smtpserver") = "smtp.cypress-mortgage.net" 
    	cdoConfig.fields.update 
     
    	Set cdoMessage = Server.CreateObject("CDO.Message") 
    	Set cdoMessage.Configuration = cdoConfig 
    	cdoMessage.From = "jamee@jameeviola.com" 
    	cdoMessage.To = "jameeviola@verizon.net" 
    	cdoMessage.Subject = "Sample CDONTS NewMail" 
    	cdoMessage.TextBody = "This is a test for CDONTS message" 
    	cdoMessage.Send 
    	Set cdoMessage = Nothing 
    	Set cdoConfig = Nothing 
    %>
    The error I get is
    error '8004020f'
    /site_build/test2.asp, line 14
    I don't have another Windows 2003 server to test this on. I have contacted the hosting company but they are not being very helpful. Any ideas of the direction I may be able to point them in?

    Thanks for your help!
  8. #5
  9. Couch Potato Wizard
    ASP Mastermind (5000+ posts)

    Join Date
    Jan 2005
    Location
    India
    Posts
    13,652
    Rep Power
    2685
    hi jam,

    u didnt tell me what error my code was pointing to!

    besides the code u wrote was missing 2 things which i think must b there.
    1. add cdoConfig.Fields.Item(sch & "smtpserverport") = 25
    and
    2. before cdoMessage.Send
    add cdoMessage.update.

    besides if ur mail is not going then mayb ur IIS has a problem.

    sorry i couldnt help!
    micky

    __________________________________________________ ________________________________
    get the mantra www.pcmantra.com
  10. #6
  11. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Dec 2004
    Posts
    16
    Rep Power
    0
    Hi micky, I've gone back to your orginal code and this is the error message I get:
    CDO.Message.1error '80040220'


    The "SendUsing" configuration value is invalid. /applications/SecureLoginManager/inc_secureloginmanager.asp, line 133
    Here is my code:
    Dim objMail, objMailConf
    Set objMail = Server.CreateObject("CDO.Message")
    Set objMailConf = Server.CreateObject("CDO.Configuration")
    objMailConf.Fields.item("http://schemas.microsoft.com/cdo/co...ation/sendusing") = 1
    objMailConf.Fields.item("http://schemas.microsoft.com/cdo/co...pickupdirectory") = "c:\inetpub\mailroot\pickup"
    objMailConf.Fields.item("http://schemas.microsoft.com/cdo/co...tion/smtpserver") = "smtp.cypress-mortgage.net"
    objMailConf.fields.Item("http://schemas.microsoft.com/cdo/co.../smtpserverport") = 25
    objMailConf.Fields.item("http://schemas.microsoft.com/cdo/co...nnectiontimeout") = 10
    objMailConf.Fields.Update
    Set objMail.Configuration = objMailConf
    objMail.From = "jamee@jameeviola.com"
    objMail.To = "jameeviola@verizon.net"
    objMail.Subject = "Mail using CDO"
    objMail.TextBody = "Hi "
    objMail.Fields.Update
    objMail.Send
    Set objMail = Nothing
    Many Thanks!
  12. #7
  13. Couch Potato Wizard
    ASP Mastermind (5000+ posts)

    Join Date
    Jan 2005
    Location
    India
    Posts
    13,652
    Rep Power
    2685
    hi jam
    try this code
    note that if u r not using localhost then sendusing =2 and pickupdirectory is not needed.
    may b it works now.

    Code:
    Dim objMail, objMailConf
    Set objMail = Server.CreateObject("CDO.Message")
    Set objMailConf = Server.CreateObject("CDO.Configuration")
    objMailConf.Fields.item("http://schemas.microsoft.com/cdo/co...ation/sendusing") = 2
    objMailConf.Fields.item("http://schemas.microsoft.com/cdo/co...tion/smtpserver") = "smtp.cypress-mortgage.net"
    objMailConf.fields.Item("http://schemas.microsoft.com/cdo/co.../smtpserverport") = 25 
    objMailConf.Fields.item("http://schemas.microsoft.com/cdo/co...nnectiontimeout") = 10
    objMailConf.Fields.Update 
    Set objMail.Configuration = objMailConf
    objMail.From = "jamee@jameeviola.com" 
    objMail.To = "jameeviola@verizon.net"
    objMail.Subject = "Mail using CDO" 
    objMail.TextBody = "Hi " 
    objMail.Fields.Update
    objMail.Send
    Set objMail = Nothing
    best of luck!
    micky

    __________________________________________________ __________________________
    Get the Mantra www.pcmantra.com

    Comments on this post

    • Shadow Wizard agrees : yep that's the way to do that...
  14. #8
  15. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Mar 2005
    Posts
    1
    Rep Power
    0

    Question


    try:

    <!--
    METADATA
    TYPE="typelib"
    UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
    NAME="CDO for Windows 2000 Library"
    -->
    <%
    Set cdoConfig = CreateObject("CDO.Configuration")

    With cdoConfig.Fields
    .Item(cdoSendUsingMethod) = cdoSendUsingPort
    .Item(cdoSMTPServer) = "<enter_mail.server_here>"
    .Update
    End With

    Set cdoMessage = CreateObject("CDO.Message")

    With cdoMessage
    Set .Configuration = cdoConfig
    .From = "from@me.com"
    .To = "to@me.com"
    .Subject = "Sample CDO Message"
    .TextBody = "This is a test for CDO.message"
    .Send
    End With

    Set cdoMessage = Nothing
    Set cdoConfig = Nothing
    %>

    from:
    http://aspfaq.com/show.asp?id=2026

    i was banging my head on the same problem for a week or so until i found this code that actually works...
  16. #9
  17. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2005
    Posts
    1
    Rep Power
    0

    Thankx lola23


    Thankx lola.....
    Even i was banging my head untill u made it stop...
    this script works.
    -sam

    Originally Posted by lola23
    try:

    <!--
    METADATA
    TYPE="typelib"
    UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
    NAME="CDO for Windows 2000 Library"
    -->
    <%
    Set cdoConfig = CreateObject("CDO.Configuration")

    With cdoConfig.Fields
    .Item(cdoSendUsingMethod) = cdoSendUsingPort
    .Item(cdoSMTPServer) = "<enter_mail.server_here>"
    .Update
    End With

    Set cdoMessage = CreateObject("CDO.Message")

    With cdoMessage
    Set .Configuration = cdoConfig
    .From = "from@me.com"
    .To = "to@me.com"
    .Subject = "Sample CDO Message"
    .TextBody = "This is a test for CDO.message"
    .Send
    End With

    Set cdoMessage = Nothing
    Set cdoConfig = Nothing
    %>

    from:
    http://aspfaq.com/show.asp?id=2026

    i was banging my head on the same problem for a week or so until i found this code that actually works...

Similar Threads

  1. CDO.Message.1 error '80070005'
    By cabi in forum ASP Development
    Replies: 1
    Last Post: November 29th, 2004, 06:42 AM
  2. CDO.Message.1 error '80070005'
    By deongee in forum ASP Development
    Replies: 2
    Last Post: November 17th, 2004, 01:13 PM
  3. CDO.Message.1 error '80040213'
    By deongee in forum ASP Development
    Replies: 2
    Last Post: November 15th, 2004, 09:45 PM
  4. Replies: 1
    Last Post: September 11th, 2004, 06:11 AM
  5. CDO.Message.1 error '80070057' - HELP
    By djstone76 in forum ASP Development
    Replies: 0
    Last Post: September 10th, 2003, 11:02 AM

IMN logo majestic logo threadwatch logo seochat tools logo