Results 1 to 9 of 9
  1. #1
    New Lounger
    Join Date
    Jan 2003
    Location
    Colorado Springs, Colorado, USA
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Send e-mail without security alert? (Access 2003/O

    From Access VBA, is there a way to send e-mail using Outlook that doesn't throw those prompts about "An application is attempting to use Outlook"? I believe this was a security patch some time ago. I've been tasked with assisting some users with former employee's Access databases. Without lots of rewriting or switching to jmail, it like to get around this issue.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Send e-mail without security alert? (Access 2003/O

    See <post#=317048>post 317048</post#> for some ways to suppress the warning "A program is attempting to ...". The free utility ClickYes is the simplest to use.

  3. #3
    New Lounger
    Join Date
    Jan 2003
    Location
    Colorado Springs, Colorado, USA
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send e-mail without security alert? (Access 20

    Thanks for the links. <img src=/S/dizzy.gif border=0 alt=dizzy width=15 height=15> <img src=/S/nuts.gif border=0 alt=nuts width=15 height=15> Wow, this is crazy. The duct tape we need to use to get this to work.

  4. #4
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Send e-mail without security alert? (Access 2003/O

    You could send an email through the smtp and bypass outlook completely...
    <pre>Sub SendSMTPMail()
    '// Send SMTP Mail messsage
    Const cdoSendUsingMethod = "http://schemas.microsoft.com/cdo/configuration/sendusing", _
    cdoSendUsingPort = 2, _
    cdoSMTPServer = "http://schemas.microsoft.com/cdo/configuration/smtpserver"
    Dim iMsg, iConf, Flds
    Dim sMsg As String, sRetAddress As String
    sRetAddress = "me@home.com"

    '// Create the CDO connections.
    Set iMsg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")
    Set Flds = iConf.Fields

    '// SMTP server configuration.
    With Flds
    .Item(cdoSendUsingMethod) = cdoSendUsingPort
    .Item(cdoSMTPServer) = "SMTPServerName" ' "<SMTP server IP address>"
    .Update
    End With

    '// Set the message properties and send
    With iMsg
    Set .Configuration = iConf
    .To = "you@home.com"
    .CC = sRetAddress
    .FROM = sRetAddress
    .Subject = "Request to obtain quote"
    .TextBody = "Can you please seek a quote for the following item." & _
    vbCr & vbCr & sMsg
    '.AddAttachment Attachment '// An attachment can be included if wanted
    .Send ' send the message.
    End With
    End Sub</pre>

    Andrew Lockton, Chrysalis Design, Melbourne Australia

  5. #5
    New Lounger
    Join Date
    Jan 2003
    Location
    Colorado Springs, Colorado, USA
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send e-mail without security alert? (Access 20

    Thanks for the code. Does it require IIS(with CDONTS) running on the machine the code is on to work?

  6. #6
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Send e-mail without security alert? (Access 20

    I don't believe so (but you are getting into a grey area for me). It certainly works for us on our standard desktop setup without anything special (and through Citrix) and I would be surprised if IIS was ever installed on our standard-build PCs.

    This link states that 'CDONTS installs with various Microsoft software products, and you can find it on most systems'
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  7. #7
    Lounger
    Join Date
    Apr 2002
    Location
    Bloomsburg, Pennsylvania
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send e-mail without security alert? (Access 2003/O

    I've just started to use CDO to send a group of emails from Access. I get a compile error on my CreateObject line. I added the reference Microsoft CDO for Windows 2000 Library. Is there some other reference that needs to be added? i didn't see any other CDO related ones.

    The compile error I get is "Object required". My line looks like this:
    Set objMessage = CreateObject("CDO.Message")

    I've tried dimensioning objMessage as string. There really is no other type that shows up that looks like it would apply.
    Also, I've seen references in posts to CDOnuts (??) or something like that. Is that different?

    Any ideas? Thanks.

  8. #8
    Lounger
    Join Date
    Apr 2002
    Location
    Bloomsburg, Pennsylvania
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send e-mail without security alert? (Access 2003/O

    I figured out how to declare this and it works now.

    Dim objMessage as CDO.Message
    Then when I do the set I don't get an error, and the emailing is working fine.

    thanks.

  9. #9
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Send e-mail without security alert? (Access 20

    I'm glad to hear you've got it working now. Sorry that the variable naming was misleading in that post where I put the code - now that I look at it, iMsg is certainly not an integer.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

Posting Permissions

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