| Home | Forums | Reviews | Articles | Register |
![]() |
| Thread Tools | Rate Thread |
|
|
|
| |
|
GeoffG
Guest
Posts: n/a
|
> Can anyone tell me if there is a way to get these
> values loaded and registered properly on a > Windows 7 Machine? I don't know the answer to the above question. However, have you tried installing Windows Live Mail (Outlook Express's successor)? Geoff "Robbo" <(E-Mail Removed)> wrote in message news:175790E9-91AC-4229-8C65-(E-Mail Removed)... > I have just bought a new computer with Windows 7 and I am > having trouble > using the following CDO function to send an e-mail unless > I include the > optional SMTP Server details. With XP, provided I > configured Outlook Express > (OE), the settings were available to me and I didn't need > to define the SMTP > Server. I understand OE writes the values to the following > registry key: > "HKEY_CURRENT_USER\Software\Microsoft\Internet Account > Manager\Accounts\00000001". However with Windows 7 I can't > use OE and I can't > figure out how to access the SMTP Server values. That > means I can't test > software on my machine that is used on all the XP machines > that need the > application. Can anyone tell me if there is a way to get > these values loaded > and registered properly on a Windows 7 Machine? The > funciton I use is as > follows: > > Function CDOEmail(sTo As String, _ > CC As String, _ > BCC As String, _ > Subject As String, _ > TextBody As String, _ > Attachment As String, _ > Optional SMTPserver As String) As Boolean > Dim iMsg As Object > Dim iConf As Object > Dim sSender As String > > 10 On Error GoTo CDOEmail_Error > > 20 fLog "CDOMail", "CDOEmail sequence commencing: " > & sTo & ", " & CC > & ", " & BCC & ", " & Subject _ > & ", " & TextBody & ", " & Attachment > > 30 If Nz(gsStoreIdent, "") = "" Then > 40 fLog "CDOEmail", "Initialiser launched > because gsStoreIdent > was: " & gsStoreIdent > 50 Initialiser > 60 End If > > 70 sSender = DLookup("Email", "tblStores", "Ident = > '" & gsStoreIdent > & "'") > 80 sSender = Mid(sSender, 1, InStr(sSender, "@") - > 1) & " <" & > sSender & ">" > > 90 Set iMsg = CreateObject("CDO.Message") > 100 Set iConf = CreateObject("CDO.Configuration") > > 110 If Len(SMTPserver) > 0 Then > Dim Flds As Variant > 120 iConf.Load -1 ' CDO Source Defaults > 130 Set Flds = iConf.Fields > 140 With Flds > 150 > .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") > = 2 > 160 > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") > _ > = SMTPserver > 170 > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") > = 25 > 180 .Update > 190 End With > 200 End If > > 210 On Error Resume Next > 220 With iMsg > 230 Set .Configuration = iConf > 240 .To = sTo > 250 .CC = CC > 260 .BCC = BCC > 270 .FROM = sSender > 280 .Subject = Subject > 290 .TextBody = TextBody > 300 If Dir(Attachment) <> "" And Attachment <> > "" Then > 310 .AddAttachment Attachment > 320 End If > 330 .Send > > 340 If Err.Number = -2147220973 Then > 350 fLog "CDOEmail", "The transport failed > to connect to the > server." > 360 CDOEmail = 0 > 370 ElseIf Err Then > 380 Stop > 390 fLog "CDOEmail", "Email failed to send " > & Err.Number & " > " & Err.Description > 400 MsgBox "Error : " & Err.Number & " " & > Err.Description & " > Please note the details of this message." > 410 CDOEmail = 0 > 420 Else > 430 CDOEmail = -1 > 440 End If > 450 End With > > 460 On Error GoTo 0 > 470 fLog "CDOMail", "CDOEmail sequence finished > normally" > 480 Exit Function > > CDOEmail_Error: > > 490 MsgBox "Error " & Err.Number & " (" & > Err.Description & ") in > procedure CDOEmail of Module CDOMail" > Exit Function > Resume > End Function > > > -- > Cheers > Rob |
|
||
|
||||
|
Robbo
Guest
Posts: n/a
|
I wish it were that simple. I tried that but it did not achieve the result
-- Cheers Rob "GeoffG" wrote: > > Can anyone tell me if there is a way to get these > > values loaded and registered properly on a > > Windows 7 Machine? > > I don't know the answer to the above question. > However, have you tried installing Windows Live Mail > (Outlook Express's successor)? > > Geoff > > > > > "Robbo" <(E-Mail Removed)> wrote in message > news:175790E9-91AC-4229-8C65-(E-Mail Removed)... > > I have just bought a new computer with Windows 7 and I am > > having trouble > > using the following CDO function to send an e-mail unless > > I include the > > optional SMTP Server details. With XP, provided I > > configured Outlook Express > > (OE), the settings were available to me and I didn't need > > to define the SMTP > > Server. I understand OE writes the values to the following > > registry key: > > "HKEY_CURRENT_USER\Software\Microsoft\Internet Account > > Manager\Accounts\00000001". However with Windows 7 I can't > > use OE and I can't > > figure out how to access the SMTP Server values. That > > means I can't test > > software on my machine that is used on all the XP machines > > that need the > > application. Can anyone tell me if there is a way to get > > these values loaded > > and registered properly on a Windows 7 Machine? The > > funciton I use is as > > follows: > > > > Function CDOEmail(sTo As String, _ > > CC As String, _ > > BCC As String, _ > > Subject As String, _ > > TextBody As String, _ > > Attachment As String, _ > > Optional SMTPserver As String) As Boolean > > Dim iMsg As Object > > Dim iConf As Object > > Dim sSender As String > > > > 10 On Error GoTo CDOEmail_Error > > > > 20 fLog "CDOMail", "CDOEmail sequence commencing: " > > & sTo & ", " & CC > > & ", " & BCC & ", " & Subject _ > > & ", " & TextBody & ", " & Attachment > > > > 30 If Nz(gsStoreIdent, "") = "" Then > > 40 fLog "CDOEmail", "Initialiser launched > > because gsStoreIdent > > was: " & gsStoreIdent > > 50 Initialiser > > 60 End If > > > > 70 sSender = DLookup("Email", "tblStores", "Ident = > > '" & gsStoreIdent > > & "'") > > 80 sSender = Mid(sSender, 1, InStr(sSender, "@") - > > 1) & " <" & > > sSender & ">" > > > > 90 Set iMsg = CreateObject("CDO.Message") > > 100 Set iConf = CreateObject("CDO.Configuration") > > > > 110 If Len(SMTPserver) > 0 Then > > Dim Flds As Variant > > 120 iConf.Load -1 ' CDO Source Defaults > > 130 Set Flds = iConf.Fields > > 140 With Flds > > 150 > > .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") > > = 2 > > 160 > > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") > > _ > > = SMTPserver > > 170 > > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") > > = 25 > > 180 .Update > > 190 End With > > 200 End If > > > > 210 On Error Resume Next > > 220 With iMsg > > 230 Set .Configuration = iConf > > 240 .To = sTo > > 250 .CC = CC > > 260 .BCC = BCC > > 270 .FROM = sSender > > 280 .Subject = Subject > > 290 .TextBody = TextBody > > 300 If Dir(Attachment) <> "" And Attachment <> > > "" Then > > 310 .AddAttachment Attachment > > 320 End If > > 330 .Send > > > > 340 If Err.Number = -2147220973 Then > > 350 fLog "CDOEmail", "The transport failed > > to connect to the > > server." > > 360 CDOEmail = 0 > > 370 ElseIf Err Then > > 380 Stop > > 390 fLog "CDOEmail", "Email failed to send " > > & Err.Number & " > > " & Err.Description > > 400 MsgBox "Error : " & Err.Number & " " & > > Err.Description & " > > Please note the details of this message." > > 410 CDOEmail = 0 > > 420 Else > > 430 CDOEmail = -1 > > 440 End If > > 450 End With > > > > 460 On Error GoTo 0 > > 470 fLog "CDOMail", "CDOEmail sequence finished > > normally" > > 480 Exit Function > > > > CDOEmail_Error: > > > > 490 MsgBox "Error " & Err.Number & " (" & > > Err.Description & ") in > > procedure CDOEmail of Module CDOMail" > > Exit Function > > Resume > > End Function > > > > > > -- > > Cheers > > Rob > > > . > |
|
||
|
||||
|
Paul Shapiro
Guest
Posts: n/a
|
I think CDO has been on the way out for some time. It's no longer included
with Outlook 2007, but must be downloaded from MS. If requiring Outlook or some other specified mail client is not an option for your users, you can use Windows Virtual PC to create a Windows XP development environment on your computer. Win 7 Professional and Ultimate include a license for a pre-built (and licensed) Win XP virtual machine that can be downloaded from MS. For other Win 7 versions I think Windows Virtual PC (the successor to Virtual PC 2007) is still available, but you need a separate Win XP license and you have to build the VM yourself. Either way it's a pretty simple setup that gets you a Win XP environment for test and/or development. However, this only helps until your first client upgrades to Win 7, when they don't have any built-in mail client. Another option is 3rd-party software that connects to a user-specified SMTP server, but that probably requires more knowledge on the part of your users since they will have to specify their own smtp server. It's certainly more convenient to use the existing mail client. "Robbo" <(E-Mail Removed)> wrote in message news:175790E9-91AC-4229-8C65-(E-Mail Removed)... >I have just bought a new computer with Windows 7 and I am having trouble > using the following CDO function to send an e-mail unless I include the > optional SMTP Server details. With XP, provided I configured Outlook > Express > (OE), the settings were available to me and I didn't need to define the > SMTP > Server. I understand OE writes the values to the following registry key: > "HKEY_CURRENT_USER\Software\Microsoft\Internet Account > Manager\Accounts\00000001". However with Windows 7 I can't use OE and I > can't > figure out how to access the SMTP Server values. That means I can't test > software on my machine that is used on all the XP machines that need the > application. Can anyone tell me if there is a way to get these values > loaded > and registered properly on a Windows 7 Machine? The funciton I use is as > follows: > > Function CDOEmail(sTo As String, _ > CC As String, _ > BCC As String, _ > Subject As String, _ > TextBody As String, _ > Attachment As String, _ > Optional SMTPserver As String) As Boolean > Dim iMsg As Object > Dim iConf As Object > Dim sSender As String > > 10 On Error GoTo CDOEmail_Error > > 20 fLog "CDOMail", "CDOEmail sequence commencing: " & sTo & ", " & > CC > & ", " & BCC & ", " & Subject _ > & ", " & TextBody & ", " & Attachment > > 30 If Nz(gsStoreIdent, "") = "" Then > 40 fLog "CDOEmail", "Initialiser launched because gsStoreIdent > was: " & gsStoreIdent > 50 Initialiser > 60 End If > > 70 sSender = DLookup("Email", "tblStores", "Ident = '" & > gsStoreIdent > & "'") > 80 sSender = Mid(sSender, 1, InStr(sSender, "@") - 1) & " <" & > sSender & ">" > > 90 Set iMsg = CreateObject("CDO.Message") > 100 Set iConf = CreateObject("CDO.Configuration") > > 110 If Len(SMTPserver) > 0 Then > Dim Flds As Variant > 120 iConf.Load -1 ' CDO Source Defaults > 130 Set Flds = iConf.Fields > 140 With Flds > 150 > .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 > 160 > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _ > = SMTPserver > 170 > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = > 25 > 180 .Update > 190 End With > 200 End If > > 210 On Error Resume Next > 220 With iMsg > 230 Set .Configuration = iConf > 240 .To = sTo > 250 .CC = CC > 260 .BCC = BCC > 270 .FROM = sSender > 280 .Subject = Subject > 290 .TextBody = TextBody > 300 If Dir(Attachment) <> "" And Attachment <> "" Then > 310 .AddAttachment Attachment > 320 End If > 330 .Send > > 340 If Err.Number = -2147220973 Then > 350 fLog "CDOEmail", "The transport failed to connect to the > server." > 360 CDOEmail = 0 > 370 ElseIf Err Then > 380 Stop > 390 fLog "CDOEmail", "Email failed to send " & Err.Number & > " > " & Err.Description > 400 MsgBox "Error : " & Err.Number & " " & Err.Description & > " > Please note the details of this message." > 410 CDOEmail = 0 > 420 Else > 430 CDOEmail = -1 > 440 End If > 450 End With > > 460 On Error GoTo 0 > 470 fLog "CDOMail", "CDOEmail sequence finished normally" > 480 Exit Function |
|
||
|
||||
|
Mark Andrews
Guest
Posts: n/a
|
I would recommend storing the SMTP server name and credentials (and any
other setting needed) in the database itself, or in your own defined registry keys. You could have an optional routine that trys to read the values from the registry (in case they are stored by another application) or allow the user to enter them. I'm not sure of your organization's email smtp server details. You could use one of the many smtp components to send mail instead of relying on CDO. I like the Ostrosoft component because it has some interaction to show what's happening when it tries to send the email and returns error codes if needed. Here's a little demo using the ostrosoft component: http://www.rptsoftware.com/products/email/ SMTP components: http://www.google.com/search?sourcei...smtp+component It looks like you are making life difficult for yourself using CDO. If you must stay with CDO try this: http://www.google.com/search?hl=en&r...&aq=f&oq=&aqi= HTH, Mark Andrews RPT Software http://www.rptsoftware.com "Robbo" <(E-Mail Removed)> wrote in message news:175790E9-91AC-4229-8C65-(E-Mail Removed)... >I have just bought a new computer with Windows 7 and I am having trouble > using the following CDO function to send an e-mail unless I include the > optional SMTP Server details. With XP, provided I configured Outlook > Express > (OE), the settings were available to me and I didn't need to define the > SMTP > Server. I understand OE writes the values to the following registry key: > "HKEY_CURRENT_USER\Software\Microsoft\Internet Account > Manager\Accounts\00000001". However with Windows 7 I can't use OE and I > can't > figure out how to access the SMTP Server values. That means I can't test > software on my machine that is used on all the XP machines that need the > application. Can anyone tell me if there is a way to get these values > loaded > and registered properly on a Windows 7 Machine? The funciton I use is as > follows: > > Function CDOEmail(sTo As String, _ > CC As String, _ > BCC As String, _ > Subject As String, _ > TextBody As String, _ > Attachment As String, _ > Optional SMTPserver As String) As Boolean > Dim iMsg As Object > Dim iConf As Object > Dim sSender As String > > 10 On Error GoTo CDOEmail_Error > > 20 fLog "CDOMail", "CDOEmail sequence commencing: " & sTo & ", " & > CC > & ", " & BCC & ", " & Subject _ > & ", " & TextBody & ", " & Attachment > > 30 If Nz(gsStoreIdent, "") = "" Then > 40 fLog "CDOEmail", "Initialiser launched because gsStoreIdent > was: " & gsStoreIdent > 50 Initialiser > 60 End If > > 70 sSender = DLookup("Email", "tblStores", "Ident = '" & > gsStoreIdent > & "'") > 80 sSender = Mid(sSender, 1, InStr(sSender, "@") - 1) & " <" & > sSender & ">" > > 90 Set iMsg = CreateObject("CDO.Message") > 100 Set iConf = CreateObject("CDO.Configuration") > > 110 If Len(SMTPserver) > 0 Then > Dim Flds As Variant > 120 iConf.Load -1 ' CDO Source Defaults > 130 Set Flds = iConf.Fields > 140 With Flds > 150 > .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 > 160 > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _ > = SMTPserver > 170 > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = > 25 > 180 .Update > 190 End With > 200 End If > > 210 On Error Resume Next > 220 With iMsg > 230 Set .Configuration = iConf > 240 .To = sTo > 250 .CC = CC > 260 .BCC = BCC > 270 .FROM = sSender > 280 .Subject = Subject > 290 .TextBody = TextBody > 300 If Dir(Attachment) <> "" And Attachment <> "" Then > 310 .AddAttachment Attachment > 320 End If > 330 .Send > > 340 If Err.Number = -2147220973 Then > 350 fLog "CDOEmail", "The transport failed to connect to the > server." > 360 CDOEmail = 0 > 370 ElseIf Err Then > 380 Stop > 390 fLog "CDOEmail", "Email failed to send " & Err.Number & > " > " & Err.Description > 400 MsgBox "Error : " & Err.Number & " " & Err.Description & > " > Please note the details of this message." > 410 CDOEmail = 0 > 420 Else > 430 CDOEmail = -1 > 440 End If > 450 End With > > 460 On Error GoTo 0 > 470 fLog "CDOMail", "CDOEmail sequence finished normally" > 480 Exit Function > > CDOEmail_Error: > > 490 MsgBox "Error " & Err.Number & " (" & Err.Description & ") in > procedure CDOEmail of Module CDOMail" > Exit Function > Resume > End Function > > > -- > Cheers > Rob |
|
||
|
||||
|
Robbo
Guest
Posts: n/a
|
Thanks Paul, That has explained things better. Appreciate your advice.
-- Cheers Rob "Paul Shapiro" wrote: > I think CDO has been on the way out for some time. It's no longer included > with Outlook 2007, but must be downloaded from MS. If requiring Outlook or > some other specified mail client is not an option for your users, you can > use Windows Virtual PC to create a Windows XP development environment on > your computer. Win 7 Professional and Ultimate include a license for a > pre-built (and licensed) Win XP virtual machine that can be downloaded from > MS. For other Win 7 versions I think Windows Virtual PC (the successor to > Virtual PC 2007) is still available, but you need a separate Win XP license > and you have to build the VM yourself. Either way it's a pretty simple setup > that gets you a Win XP environment for test and/or development. However, > this only helps until your first client upgrades to Win 7, when they don't > have any built-in mail client. > > Another option is 3rd-party software that connects to a user-specified SMTP > server, but that probably requires more knowledge on the part of your users > since they will have to specify their own smtp server. It's certainly more > convenient to use the existing mail client. > > "Robbo" <(E-Mail Removed)> wrote in message > news:175790E9-91AC-4229-8C65-(E-Mail Removed)... > >I have just bought a new computer with Windows 7 and I am having trouble > > using the following CDO function to send an e-mail unless I include the > > optional SMTP Server details. With XP, provided I configured Outlook > > Express > > (OE), the settings were available to me and I didn't need to define the > > SMTP > > Server. I understand OE writes the values to the following registry key: > > "HKEY_CURRENT_USER\Software\Microsoft\Internet Account > > Manager\Accounts\00000001". However with Windows 7 I can't use OE and I > > can't > > figure out how to access the SMTP Server values. That means I can't test > > software on my machine that is used on all the XP machines that need the > > application. Can anyone tell me if there is a way to get these values > > loaded > > and registered properly on a Windows 7 Machine? The funciton I use is as > > follows: > > > > Function CDOEmail(sTo As String, _ > > CC As String, _ > > BCC As String, _ > > Subject As String, _ > > TextBody As String, _ > > Attachment As String, _ > > Optional SMTPserver As String) As Boolean > > Dim iMsg As Object > > Dim iConf As Object > > Dim sSender As String > > > > 10 On Error GoTo CDOEmail_Error > > > > 20 fLog "CDOMail", "CDOEmail sequence commencing: " & sTo & ", " & > > CC > > & ", " & BCC & ", " & Subject _ > > & ", " & TextBody & ", " & Attachment > > > > 30 If Nz(gsStoreIdent, "") = "" Then > > 40 fLog "CDOEmail", "Initialiser launched because gsStoreIdent > > was: " & gsStoreIdent > > 50 Initialiser > > 60 End If > > > > 70 sSender = DLookup("Email", "tblStores", "Ident = '" & > > gsStoreIdent > > & "'") > > 80 sSender = Mid(sSender, 1, InStr(sSender, "@") - 1) & " <" & > > sSender & ">" > > > > 90 Set iMsg = CreateObject("CDO.Message") > > 100 Set iConf = CreateObject("CDO.Configuration") > > > > 110 If Len(SMTPserver) > 0 Then > > Dim Flds As Variant > > 120 iConf.Load -1 ' CDO Source Defaults > > 130 Set Flds = iConf.Fields > > 140 With Flds > > 150 > > .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 > > 160 > > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _ > > = SMTPserver > > 170 > > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = > > 25 > > 180 .Update > > 190 End With > > 200 End If > > > > 210 On Error Resume Next > > 220 With iMsg > > 230 Set .Configuration = iConf > > 240 .To = sTo > > 250 .CC = CC > > 260 .BCC = BCC > > 270 .FROM = sSender > > 280 .Subject = Subject > > 290 .TextBody = TextBody > > 300 If Dir(Attachment) <> "" And Attachment <> "" Then > > 310 .AddAttachment Attachment > > 320 End If > > 330 .Send > > > > 340 If Err.Number = -2147220973 Then > > 350 fLog "CDOEmail", "The transport failed to connect to the > > server." > > 360 CDOEmail = 0 > > 370 ElseIf Err Then > > 380 Stop > > 390 fLog "CDOEmail", "Email failed to send " & Err.Number & > > " > > " & Err.Description > > 400 MsgBox "Error : " & Err.Number & " " & Err.Description & > > " > > Please note the details of this message." > > 410 CDOEmail = 0 > > 420 Else > > 430 CDOEmail = -1 > > 440 End If > > 450 End With > > > > 460 On Error GoTo 0 > > 470 fLog "CDOMail", "CDOEmail sequence finished normally" > > 480 Exit Function > > . > |
|
||
|
||||
|
|
|
| |
![]() |
| Thread Tools | |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What gets an email caught by Junk email folder - default settings? | JM | Microsoft Outlook | 3 | 15th May 2007 08:53 PM |
| email - default settings... | =?Utf-8?B?UGF0J3MgZmFu?= | Microsoft Outlook Discussion | 0 | 21st Jan 2006 03:00 PM |
| problem with Desired Default email settings for multiple email acc | =?Utf-8?B?ZGFuY2luZ21pY2U=?= | Microsoft Outlook Installation | 0 | 3rd Mar 2005 12:33 AM |
| Default settings for email | =?Utf-8?B?Um9i?= | Microsoft Outlook Installation | 1 | 20th Apr 2004 01:24 AM |
| Re: default email application settings | Robert Aldwinckle | Windows XP Internet Explorer | 0 | 13th Jul 2003 04:37 AM |
Powered by vBulletin®. Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2010, Crawlability, Inc. |




