title: How to send mail when the .Send does not work?
body: <p>I am trying to send email through VBA.</p>
  
  <p>When the .Send wouldn't work, I found the Sendkeys method which works but the email has to display and then you can't touch the computer or you may disrupt the macro.</p>
  
  <p>How can I make the .Send method work? </p>
  
  <pre><code>    Dim OutApp As Object
      Dim OutMail As Object
      Dim count As Integer
  
      EmailTo = Worksheets("Email Addresses").Range("A2")
  
      Set OutApp = CreateObject("Outlook.Application")
      Set OutMail = OutApp.CreateItemFromTemplate( _
      Sheets("Start Here").Range("B25"))
  
      On Error Resume Next
      With OutMail
  
          .To = EmailTo
          '.CC = ""
          '.BCC = ""
          '.Subject = ""
          '.Body = ""
          '.Attachments.Ad' ActiveWorkbook.FullName
          ' You can add other files by uncommenting the following line.
          '.Attachments.Add ("C:\test.txt")
          ' In place of the following statement, you can use ".Display" to
          ' display the mail.
          '.Display
          'SendKeys "^{ENTER}" ' &lt;---this was the fix I found when .Send didn't work
          .Send
  
      End With
      On Error GoTo 0
  
      Set OutMail = Nothing
      Set OutApp = Nothing
  </code></pre>