Coding for closing down an automatic email

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AllusiveKitten
    New Member
    • Feb 2007
    • 43

    Coding for closing down an automatic email

    Hi all,

    I really hope I can explain myself properly, I have set up coding to send multiple automatic emails which is working super! Each email that is being sent I receive the security Pop up box that say someone is trying to send an email on behalf of myser.

    My question is, is there a code I can put in for when someone presses the No button because at the moment when it is pressed, I am getting a debug error.

    Thank you for you help
    AK
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    You should look into the CDO security in this article:


    It will allow the emails to be sent without security warning.

    Nic;o)

    Comment

    • AllusiveKitten
      New Member
      • Feb 2007
      • 43

      #3
      Hi Nico,

      I have had a read of the document and I am sorry to say that it has gone completely over my head. Can you please give me just a little hint on how to go about removing the warning?

      Thank you for you help
      AK

      Comment

      • nico5038
        Recognized Expert Specialist
        • Nov 2006
        • 3080

        #4
        Sorry, that was the "more difficult" link and now I realize that it doesn't hold sample code.
        Try the sample code of this link:


        The commentlines should provide all information, but don't hesitate to ask when you get stuck !

        Nic;o)

        Comment

        • AllusiveKitten
          New Member
          • Feb 2007
          • 43

          #5
          Originally posted by nico5038
          Sorry, that was the "more difficult" link and now I realize that it doesn't hold sample code.
          Try the sample code of this link:


          The commentlines should provide all information, but don't hesitate to ask when you get stuck !

          Nic;o)
          Hi Nico,

          I have just tried the coding that they provide, I think this is just to show how to send an email.... this coding give 2 security pop ups and 1 coded Msgbox.

          Below is the code I have for my emails to send, in my full version I have a loop that goes until all emails are sent.


          Code:
          Sub ReminderEmails()
          
          Dim Email As String
          Dim EmailName As String
          Dim strNote As String
          Dim objOutlook As Outlook.Application
          Dim objEmail As Outlook.MailItem
          
          EmailName = "email@address.com.au"
                     
                          strNote = "Dear " & EmailName & vbCrLf & vbCrLf
                          strNote = strNote & "the rest of the message " 
          
                          Set objOutlook = CreateObject("Outlook.application")
                          Set objEmail = objOutlook.CreateItem(olMailItem)
                           
                          With objEmail
                              
                              .To = Email
                              .Subject = "Subject Title"
                              .Body = strNote
                              .Send
                          End With
                          
                           Set objEmail = Nothing
                  
          End Sub
          I am just worried that another user is going to hit "No" when the Security Box comes up which will then give them the Debug Message box & give them access to the coding which can be dangerous when they dont know anything about it.

          I really appreciate all the help you are giving me.

          Thank you
          AK

          Comment

          • nico5038
            Recognized Expert Specialist
            • Nov 2006
            • 3080

            #6
            By turning the .mdb into a .mde the code will be "precompile d" and invisible for your users.
            That's the most secure way to prevent them to see (and edit) your code.

            Nic;o)

            Comment

            Working...