title: Get rid of warning message for VBA-sent email
body: <p>I have an alert sending aid built into an Access database that sends emails to all technicians with an expired/ing induction, all in one go. Every email requires permission to send.</p>
  <hr />
  <p>Similar to <a href="https://stackoverflow.com/questions/16168027/how-can-i-supress-the-outlook-warning-while-sending-mail-using-macro-in-excel">this question</a> and <a href="https://stackoverflow.com/questions/21026491/sending-emails-from-excel-using-outlook-without-security-warning">this question</a> but I need to send multiple emails automatically all at once, without holding up other processes.<br />
  The code in the questions seems to send a single email, and the only accepted answer involves waiting five seconds up to three times to check that the actual message had been displayed so that <code>SendKeys</code> would work on that window.</p>
  <p>If I use <code>SendKeys</code> with a 5 second pause built in to wait for confirmation <a href="https://stackoverflow.com/a/18264196/9513577">as Graham Anderson suggests</a>, this won't speed up the process, only avoid some clicking. The progress bar shown on the warning (below) takes roughly that time to fill, so I'm guessing that's the system building the email, which is what the wait is for.</p>
  <p>The same problem applies to <a href="https://stackoverflow.com/a/29921482/9513577">Julia's answer</a> to the other question - the warning box won't let you click &quot;Allow&quot; until the progress bar is full, so code that auto clicks this button will have to wait to complete at best.</p>
  <p>I tried <code>DoCmd.SetWarnings (False)</code> (and then <code>DoCmd.SetWarnings (True)</code> after sending) but that doesn't stop this particular one. This may be because the warning comes from Outlook rather than Access.</p>
  <hr />
  <p>The coding I have:</p>
  <pre class="lang-vb prettyprint-override"><code>Private Sub SendAlerts_Click()
      Dim db As Database, rs As Recordset
      Dim Subject As String, Body As String, EmailAddress As String
      Dim Recipient As String, Induction As String, Expiry As String
      Set db = CurrentDb
      Set rs = db.OpenRecordset(&quot;qryExpiryAlert&quot;, dbOpenDynaset)
  
      Do Until rs.EOF
          EmailAddress = rs!Email
          Recipient = rs!FullName
          Induction = rs!Induction
          Expiry = rs!ExpiryDate
          Subject = &quot;Inductions need renewal&quot;
          Body = &quot;Hi &quot; &amp; Recipient &amp; &quot;, the expiry for your &quot; &amp; Induction &amp; _
              &quot; certificate is &quot; &amp; Expiry &amp; &quot;. Please send a current certificate asap.&quot;
  
          DoCmd.SendObject , , , EmailAddress, , , Subject, Body, False
          
          rs.MoveNext
      Loop
      
      DoCmd.Close
      
  End Sub
  </code></pre>
  <p>Here is the warning:<br />
  <a href="https://i.stack.imgur.com/Mc9Dp.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Mc9Dp.jpg" alt="enter image description here" /></a></p>