Results 1 to 12 of 12

Thread: cdo fails on Vista

  1. #1

    Thread Starter
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    cdo fails on Vista

    I am trying to get my app to run on vista. When try to send an email from vb6 using cdo it gives the following error: The "SendUsing" configuration value is invalid. This works fine on xp. What could be the problem ?
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

  2. #2
    Addicted Member
    Join Date
    Jul 2007
    Posts
    228

    Re: cdo fails on Vista

    I'm using CDO and have tested and is running AOK on Vista Home and Vista 64. Are you early or late binding the CDO Library? What's your code look like? Where do you get the error?

  3. #3

    Thread Starter
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: cdo fails on Vista

    Quote Originally Posted by Tom Moran
    I'm using CDO and have tested and is running AOK on Vista Home and Vista 64. Are you early or late binding the CDO Library? What's your code look like? Where do you get the error?
    Haven't had a chance to check the the exact place in my code yet I just bought Vista Ultimate 64 and found a whole bunch of little bugs to fix and have been fixing them 1 by 1 Setup, install, out of range etc. What would determine late binding ?
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

  4. #4
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    Re: cdo fails on Vista

    well vista has an option in the compability, run as xp. it might work: right click the program, properties and compability then check run as and choose windows xp service pack (2.0) i think it is.

  5. #5
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: cdo fails on Vista

    it is probably a security issue an vista, so you need to set the sendusing as required in cdo
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  6. #6

    Thread Starter
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: cdo fails on Vista

    Quote Originally Posted by Justa Lol
    well vista has an option in the compability, run as xp. it might work: right click the program, properties and compability then check run as and choose windows xp service pack (2.0) i think it is.
    That would be a last resort for my situation as have many customers that are not computer savvy and they just want stuff to work.
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

  7. #7

    Thread Starter
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: cdo fails on Vista

    Quote Originally Posted by westconn1
    it is probably a security issue an vista, so you need to set the sendusing as required in cdo
    What do you mean by sendusing ?
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

  8. #8

    Thread Starter
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: cdo fails on Vista

    I am now putting line numbers in the send routine to see if i can narrow the problem. I am using xp compiling then flash drive then vista, so i'll be back with a more meaningful error.
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

  9. #9

    Thread Starter
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: cdo fails on Vista

    Error is on line 430: (objMessage.Send)
    Code:
    Private Sub cmdSend_Click()
              Dim ccToSender As Boolean
              Dim lFilesize As Long
              Dim objMessage
    10        On Error GoTo e
              
    20        If Not CheckInternetConnection Then
    30             Call MsgBox("You must be connected to the internet to send email" _
                          & vbCrLf & "Connect and try again" _
                          , vbExclamation, App.Title)
    40          GoTo bail
              
    50        End If
              
              
    100       Set objMessage = CreateObject("CDO.Message")
              
    110         If txtUserName <> "" Then
    120           objMessage.From = Me.txtUserName ' "[email protected]"
    130         End If
              
    140    If txtTo <> "" Then 'To email
    150         If Me.ckCcToSender = vbChecked Then 'send a copy to sender
    160           objMessage.To = txtTo & ";" & txtFromEmail '"[email protected]"
    170          Else
    180          objMessage.To = txtTo
    190         End If
                 
    200     Else
    210          Call MsgBox("Recipient Email cannot be missing", vbExclamation, "Recipient Email missing")
    220          GoTo bail
    230    End If
               
    240       If txtCc <> "" Then
    250            objMessage.cc = txtCc
    260           End If
    
              
    270      If txtBcc <> "" Then
    280        objMessage.BCC = Me.txtBcc
    290      End If
    
    300       objMessage.ReplyTo = Me.txtFromEmail
    
    310        objMessage.Subject = Me.txtSubject
    
          ' Construct Email Body
    
    320   objMessage.TextBody = Me.txtMsg
    
    330       If Me.txtAttach <> "" Then
    340             If Dir$(txtAttach) <> "" Then 'valid to be sure the file is there
    350               objMessage.AddAttachment txtAttach '.Path & "\instructions.rtf"
    360             Else
    370               Select Case MsgBox("The attachment file was not found" _
                                         & vbCrLf & "Check your files  path and spelling to send the file" _
                                         & vbCrLf & "To continue sending your message without the attachment Click OK (your attachment will not be sent)" _
                                         & vbCrLf & "To stop and edit your attachment click Cancel" _
                                         & vbCrLf & "" _
                                         , vbOKCancel Or vbExclamation Or vbDefaultButton1 Or vbMsgBoxHelpButton, "File not found", App.HelpFile, 27)
                      
                          Case vbOK
                           'do nothing, just continue
    380                   Case vbCancel
    390                    GoTo bail
    400               End Select
    410             End If
    420           End If
    
    
    430   objMessage.Send
    440    Call MsgBox("Your email sent", vbInformation, "Email Sent")
           
    450       Set objMessage = Nothing
           
    bail:
           
    460   Exit Sub
    e:
    470   MsgBox "Error " & err.Number & " (" & err.Description & ") cmdSend_Click frmMain, Line: " & Erl
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

  10. #10
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: cdo fails on Vista

    Error is on line 430: (objMessage.Send)
    of course that is where the error is you need to set the sendusing before sending
    for detais see http://msdn.microsoft.com/en-us/libr...EXCHG.10).aspx

    here are the constants
    cdoSendUsingPickup


    1


    Send message using the local SMTP service pickup directory.

    cdoSendUsingPort


    2


    Send the message using the network (SMTP over the network).
    didn't copy real well,
    set to 2 to send
    you may also need to set some other properties, like the smtp server
    if that is a problem try sending all through some external stmp server such as gmail or GMX, note gmail use ssl and different port but all users can use the same account to send mail to you
    you can find settings for gmail and gmx in this forum in threads that have replies by me, gmail has limitations on attachment types, but i believe gmx is ok,
    watch out for isps that block outgoing messages on specific ports (specifically port 25)
    Last edited by westconn1; Feb 21st, 2009 at 04:02 AM.
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  11. #11

    Thread Starter
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: cdo fails on Vista

    Quote Originally Posted by westconn1
    of course that is where the error is you need to set the sendusing before sending
    for detais see http://msdn.microsoft.com/en-us/libr...EXCHG.10).aspx

    here are the constants
    didn't copy real well,
    set to 2 to send
    you may also need to set some other properties, like the smtp server
    if that is a problem try sending all through some external stmp server such as gmail or GMX, note gmail use ssl and different port but all users can use the same account to send mail to you
    you can find settings for gmail and gmx in this forum in threads that have replies by me, gmail has limitations on attachment types, but i believe gmx is ok,
    watch out for isps that block outgoing messages on specific ports (specifically port 25)
    xp had no problem with code i gave. The users are not sending mail to me they are emailing proposal, invoices, etc as attachments. I was using vbsendmail, but it had too many options for users, so i switched to cdo and in xp is all they had to supply was the to & from. This is going to be an adventure to get to work and still not be confusing for my users.
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

  12. #12
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: cdo fails on Vista

    that is why i suggested possibly using an external stmp server, one setting works for all

    if you need to set stmp server it should be possible to get that from the default email client settings in the registry, even in xp it would not work for any user with no email client set up
    Last edited by westconn1; Feb 21st, 2009 at 04:45 AM.
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width