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 ?
Printable View
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 ?
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 ?Quote:
Originally Posted by Tom Moran
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.
it is probably a security issue an vista, so you need to set the sendusing as required in cdo
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.Quote:
Originally Posted by Justa Lol
What do you mean by sendusing ?Quote:
Originally Posted by westconn1
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.
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
of course that is where the error is you need to set the sendusing before sendingQuote:
Error is on line 430: (objMessage.Send)
for detais see http://msdn.microsoft.com/en-us/libr...EXCHG.10).aspx
here are the constants
didn't copy real well,Quote:
cdoSendUsingPickup
1
Send message using the local SMTP service pickup directory.
cdoSendUsingPort
2
Send the message using the network (SMTP over the network).
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.Quote:
Originally Posted by westconn1
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