I am having trouble sending emails when installing my app on vista. The cdosys.dll on xp is 2043kb ver 6.2.4 and vista is 787kb ver 6.6.6001. Does anyone know why ?
Printable View
I am having trouble sending emails when installing my app on vista. The cdosys.dll on xp is 2043kb ver 6.2.4 and vista is 787kb ver 6.6.6001. Does anyone know why ?
Are you early binding? I believe you are... I could be wrong :)
Try late binding...
I am doing it like this:Quote:
Originally Posted by koolsid
Make reference then:
Dim objMessage
Set objMessage = CreateObject("CDO.Message")
Is this early ? How do you do late binding ?
What do you mean by this...Quote:
Make reference then:
This is late binding...Quote:
CreateObject("CDO.Message")
Make a referenceQuote:
Originally Posted by koolsid
Project>References>Microsoft CDO For Windows 2000 library. Do you have vista ? I think the problem is the size and version. I have not tried replacing the dll with xp's yet
Umm, I thought so... This is early bindingQuote:
Make a reference
Project>References>Microsoft CDO For Windows 2000 library.
You are mixing Early and Late together...
Remove that reference and try again... If it still doesn't work, then can I see the begining of the code where you are trying to connect...
Dim objMessageQuote:
Originally Posted by koolsid
Code:Set objMessage = CreateObject("CDO.Message")
objMessage.Organization = "Frank zebra construction"
objMessage.From = Me.txtUserName ' "[email protected]"
objMessage.To = txtTo
objMessage.cc = txtCc
objMessage.BCC = Me.txtBcc
objMessage.ReplyTo = Me.txtFromEmail
objMessage.Subject = Me.txtSubject
objMessage.TextBody = Me.txtMsg
objMessage.AddAttachment txtAttach 'path to attachment
objMessage.Send
Set objMessage = Nothing
MsgBox "Mail sent"
Ok, I'll come to the above code in a moment... Did you try what I said in the previous post?
Quote:
Remove that reference and try again... If it still doesn't work
I will try it pretty soon. Not that easy as i am developing on xp flash drive then vista. Read an article where app made on vista sometimes will have problems on xpQuote:
Originally Posted by koolsid
Ok post back when you do that... we will take it from there ;)
Edit: I am sorry... Seems I misread the code... it's latebinding... Just remove the reference and then run the program in vista...
I get an error on vista "The send configuration is invalid", just like before.Quote:
Originally Posted by koolsid
I removed the reference in xp and it still sent the email, but not xp
I believe you need to add this as well... let me try it in vista...
Set objCDOConfig = CreateObject("CDO.Configuration")
I am in XP now and am downloading something... Will take another 1/2 before i can reboot into vista...
this is i am sure a security issue in vista, you will need to set configuration options in cdo, as koolsid says you do not need any reference to any components when you use createobject, to create an instance objectQuote:
I get an error on vista "The send configuration is invalid", just like before.
but it looks like this is the same as http://www.vbforums.com/showthread.p...vista+security
google produced many results, here the first one with some test code and explanation
http://weblogs.asp.net/steveschofiel...5-and-587.aspx
This certainly looks like it may be problematic for you.
Here is what I know
CDO for Windows, also known as CDO 2.0 or CDOSYS is not "different" in Vista from the one in XP except for the compiled version. This entirely different from COM interface versioning, which stays the same.
What this means: You can use early or late binding, it makes no difference. The newer CDOSYS.DLL did not break binary compatibility with previous versions.
The way you are using CDO in your code relies on the default configuration. This default normally uses the Outlook Express (OE) default email account's settings for the currently loaded user profile.
However: If the machine has the IIS SMTP service installed, the installation process causes CDO's default to be to use the local SMTP service's outgoing drop directory instead of sending to a remote server via SMTP.
This means the way you are using CDO will only ever work (even on XP or Win2K) if the user doesn't install IIS, since I believe the default IIS install on those OSs installs the SMTP service too. Furthermore, the user your program runs under must have a valid SMTP/POP3 default account set up in OE, or possibly some 3rd party email clients that are CDO-compatible.
Vista does not have this IIS SMTP service at all, even if IIS is installed.
Other things I suspect
Vista has no OE. Instead there is "Windows Mail."
Is this just OE, renamed? Is it still CDO-compatible? I'm not sure of either. However Windows 7 has no Outlook Express or Windows Mail at all!
Furthermore, many anti-virus suites may now interfere with CDO-originated email. It looks like some of them "hook" (intercept) any outbound connections on TCP port 25! You might get away with disabling outbound email scanning in them though. How will you do this for your users???
My test results
I tried a test using a CDO.Configuration object instead of letting a CDO.Message default. I set everything up for SMTP port 25 to my ISP's email server with a valid account/password in a way i have used in the past with no trouble.
Under Vista with AVG Free installed I get a "transport error" no matter what I try, i.e. even with outbound email scanning turned off in AVG.
Under Windows 7 with no anti-virus I am getting "SendUsing config" errors I can't seem to resolve.
Both of these setups "should" work, even with no default email profile set up because I'm not relying on a default configuration. The same program fails two different ways. I suspect:
- AVG is interfering on Vista.
- Something else is needed to set CDO up properly for Windows 7.
I may have to try rebooting on the Vista/AVG machine first, to make sure AVG is not trying to proxy my outbound email. I'm not sure where to begin with Windows 7. My guess is that with no OE or similar on Windows 7, CDO requires something that is missing.
Your Vista setup there might be missing the same "something."
I replaced the different cdosys.dll with the one from xp with no change, same error. I switched from vbsendmail to cdo, about a year ago because users were have to much difficulty with all the options in vbsendmail. My software is roof estimating and the users are not computer wizes. With the problem with vista and probably more in windows 7 it looks like i might to switch to something else, maybe a 3rd party ocx or ? This has sure become a major unexpected hurdle with making my app work on vista. Emailing rtf attachments (Contracts, Invoices, Purchase Orders, etc) is a nice feature with my app and I cannot abandon it. I sure do appreciate all the feedback and help.
I feel your pain, believe me. But just doing some testing leads me to conclude that this can never be reliable for a machine you cannot administer. It isn't just a Vista issue, XP can be just as problematic.
The user might have AV or firewall software that will end up blocking any attempt to send SMTP email. The user may have IIS/SMTP installed so your use of the default config would fail. The user might not use Outlook Express/Windows Mail at all, so the default config would fail (maybe they use Outlook/Exchange, maybe web based email, etc.). The list goes on (and on).
All of this comes from the arms race between malware creators that turn users' machines into "spam zombies" and the email client, anti-virus, and firewall vendors as well as the ISP community, email server vendors, and server administrators to combat this plague.
If you just needed to have your program send "phone home" emails (crash reports, etc.) there might be other answers that aren't too awful. I suspect that you are sending emails that go out to your clients' customers though. This is a bit trickier.
The solution in both cases would require that you have a server on the public Internet of your own. That server would accept "email" requests using some alternative to SMTP (example: a SOAP web service or even a simpler HTTP POST), validate them, then format and relay as SMTP emails to the real destination. This would be a kind of email relay not based on SMTP (which is what everything is trying to protect users from).
Not an ideal solution.
Another thing to consider: How much software do you use that spawns emails anymore? Probably none.
There is a reason for this.
I have decided to drop cdo and go another route.Quote:
Originally Posted by dilettante
This has put me in a bind. I am a retired roofing contractor and my coding knowledge is really limited. I paid a renta coder last year to set up this:
Users can email me with ideas thru my online Jmail on my website, also silently emails me if any errors giving the module, error number, error description, line #, procedure name, OS, etc and this still works on Vista. This only gets sent to me with no attachments so I don't know if it could be reconfigured to send to other people with attachments. I always warn people that a possible failure could be a firewall. Right now i am looking at a ocx (Not free) that may do what I need: http://www.emailarchitect.net/webapp/smtpcom/. At this point I am investigating on which way to go. Have learned that before buying anything investigate. The 1st thing i usually check is their email response time. Thanks for your feedback on this
What do you mean by spawns ?Quote:
Originally Posted by dilettante
Any program besides an explicit email client that sends SMTP email, basically. It just isn't considered practical anymore.Quote:
Originally Posted by isnoend07