Access to Outlook without security warning, without SMTP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dk4300
    New Member
    • Mar 2007
    • 68

    Access to Outlook without security warning, without SMTP

    I am building an Access 2007 database to automatically send out multiple emails (1-500 with one attachment each) via Outlook. I need to have multiple users in a secure corporate enviornment be able to run it from their desktops. What is the current best code for this excluding SMTP which is what I've seen on some of the forums?
    Thank you.
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32634

    #2
    The security warning is not a mistake. It's there to ensure that code outside of Outlook does not have access to sending emails without confirmmation from the user. This is because such code can be used for malicious purposes.

    Comment

    • Adam Tippelt
      New Member
      • Nov 2010
      • 137

      #3
      If you try searching on something like "Sending emails through Outlook with Access", there are a few ways out there that will allow you to setup some sort of 'trusted' connection so Outlook will automatically send emails from Access.

      Adam.

      Comment

      • dk4300
        New Member
        • Mar 2007
        • 68

        #4
        NeoPa- Yes, but in my case the user is the one initiating the sending of the emails. We don't need the security window because the emails are not malicious.

        Comment

        • Rabbit
          Recognized Expert MVP
          • Jan 2007
          • 12517

          #5
          Your email may not be malicious but if you open it up, then anyone can send email through you.

          Comment

          • dk4300
            New Member
            • Mar 2007
            • 68

            #6
            Adam Tippelt- I have looked. Ultimately people recommend SMTP.
            Do you know any good references for setting up a 'trusted' connection?

            I'm just wondering if there are ways for Access and Outlook to work together for regular ol' business processing involving automated weekly emails.
            Thanks!!

            Comment

            • dk4300
              New Member
              • Mar 2007
              • 68

              #7
              Rabbit,
              "Open it up" as in the Outlook security? That makes sense, but does that really mean that you can't send automated emails from Access to Outlook?

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32634

                #8
                Originally posted by dk4200
                dk4200:
                NeoPa- Yes, but in my case the user is the one initiating the sending of the emails. We don't need the security window because the emails are not malicious.
                As Rabbit implies, that's rather missing the point.

                I would naturally assume you weren't coming on here as a regular poster asking us to help you send malicious emails. Nevertheless, the design of the operating system and it's security is unlikely to take your bona fides into consideration.

                Nor would it be responsible behaviour to reduce the inbuilt protection of any client's system to ensure your emails went out without restriction. You could then be held responsible (quite rightly in my view) for any malicious software propagating itself via the open portal. You don't even want to think about the financial penalty that lot could bring with it. I expect any future employment prospects would be squarely outside of IT.

                Comment

                • dk4300
                  New Member
                  • Mar 2007
                  • 68

                  #9
                  I don't disagree with anything you are saying and I understand that the purpose of the security message is to prevent automatically sending email messages.

                  I'm not looking at or interested in decreasing the security of users email accounts. I only wanted to make sure that there is not some option that I don't know about where you can somehow use Access (2007) and Outlook together to send safe, permitted, user initiated emails. Some way to "Allow" more than one email at a time.

                  These responses tell me that the answer is no? There is not a way to automate email generation through Outlook bypassing the security message. The only options for auto generating emails is to change your outlook security settings across the board or email via SMTP?

                  Comment

                  • NeoPa
                    Recognized Expert Moderator MVP
                    • Oct 2006
                    • 32634

                    #10
                    Originally posted by dk4300
                    dk4300:
                    These responses tell me that the answer is no? There is not a way to automate email generation through Outlook bypassing the security message. The only options for auto generating emails is to change your outlook security settings across the board or email via SMTP?
                    An impressive response all-in-all, and I'm pleased to take your points.

                    Firstly let me say that I was not more definitive earlier on the first question, simply because I don't know. I suspect the answer may be No as I too have been interested in being able to do such a thing for a few years (although I haven't kept the search up every day of course). My understanding is that there may be options in some circumstances (Specifically when dealing with Outlook in an Exchange Server environment), but I'm not sure how far they go and to what extent they may answer your question (I can't even link you to them as I haven't seen them for a long time now). There may also be something out there I simply haven't discovered. I've never felt the lack of recollection or discovery of something has ever been a good reason to declare it non-existent. Remembering something can show it's there, but the reverse is never supported.

                    Certainly, my recollections of all I ever found leads me to believe that the solution most people use is to create and send SMTP packets directly. While it's true this does work in many environments nowadays it seems, I know that a properly configured firewall and email server setup would preclude any such messages getting outside of the local network (In other words they could be sent ok but would be blocked by the firewall if sent outside directly, or by the email server if an attempt were made to relay via the said server. This would be configured such that only a strictly limited set of IP addresses could initiate SMTP that would be allowed outside of the company network). I would say that such a security configuration is by no means universal even now. I expect we'd all see far fewer spam emails if they were :-(

                    Ultimately, I'm sorry I cannot give you definitive answers to your questions, even if I have hopefully opened yours and others eyes to some of the reasons why this is such a tricky subject to deal with in the first place.

                    Comment

                    • munkee
                      Contributor
                      • Feb 2010
                      • 374

                      #11
                      Can I just query the reasoning for being unable to use the SMTP?

                      My company uses some quite crazy security but there is always a way around this.

                      If you are using outlook then you have direct access to the SMPT even with windows authentication. I can provide the necessary code to do this if required.

                      Aside from that there is a third party addon for outlook called "outlook redemption" you will probably come across this mentioned whilst on your travels. However I do not recommend it at all. It is a complete pain to distribute out to the required people using your database and if anything is likely to cause much more issues with your IT guys than just sending emails through the SMTP via code.

                      Comment

                      • NeoPa
                        Recognized Expert Moderator MVP
                        • Oct 2006
                        • 32634

                        #12
                        Originally posted by Munkee
                        Munkee:
                        Can I just query the reasoning for being unable to use the SMTP?
                        You can (Why didn't you :-S). I believe all the explanation is already in post #10 though. If you have a question that isn't answered there, feel free to ask it.

                        Originally posted by Munkee
                        Munkee:
                        If you are using outlook then you have direct access to the SMPT even with windows authentication.
                        This is certainly true (as Outlook is also an SMTP node as well as a client for Exchange), however, in as much as it is used in that way it has no more chance of getting past the SMTP security (if any is set up of course) than any other SMTP node.

                        Comment

                        • dk4300
                          New Member
                          • Mar 2007
                          • 68

                          #13
                          From reading a post by Adezii:


                          I removed the recordsets and got:
                          Code:
                          Sub SendEmailBytes()
                          'Provides the Send Mail automation. Send an E-Mail and
                          'Attachments from Access via Outlook to Multiple Recipients
                          Dim oLook As Object
                          Dim oMail As Object
                          Dim olns As Outlook.NameSpace
                          Dim MyDB As DAO.Database
                          Dim strBuild As String
                          
                          Set oLook = CreateObject("Outlook.Application")
                          Set olns = oLook.GetNamespace("MAPI")
                          Set oMail = oLook.CreateItem(0)
                           
                          With oMail
                          
                              .To = Left$(strBuild, Len(strBuild) - 1)            'Strip Trailing ';'
                            
                              .Body = "Text in the Body of the E-Mail"
                            
                              .Subject = "Some Interesting Subject"
                          
                            
                              .Display          'Displays the Outlook Screen instead of automatically Sending
                                                'the Email. You can change this to .Send to Auto Send
                          End With
                            
                          Set oMail = Nothing
                          Set oLook = Nothing
                          
                          End Sub
                          But on line:
                          Code:
                          Set oLook = CreateObject("Outlook.Application")
                          Get:
                          Run-time error '424'
                          Object Required

                          I have the reference to the Microsoft Outlook 12.0 Object Library checked

                          Does anyone know what causes this?

                          Comment

                          • NeoPa
                            Recognized Expert Moderator MVP
                            • Oct 2006
                            • 32634

                            #14
                            Your line #4 defines oLook as an Object, whereas the original code you copied from defines it as an Outlook.Applica tion. With such an obvious difference I'd start my search there.

                            Comment

                            Working...