Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. Sub Send_Emails()
  2.  
  3. Dim OutApp As Object: Set OutApp = CreateObject("Outlook.Application")
  4. Dim OutMail As Object: Set OutMail = OutApp.CreateItem(0)
  5.  
  6. 'Send Email
  7. With OutMail
  8. .to = "john.doe@mycompany.com"
  9. .Subject = "This is the Subject"
  10. .Body = "This is message"
  11. .Display
  12. End With
  13.  
  14. On Error Resume Next:
  15. OutMail = Nothing
  16. OutApp = Nothing
  17. End Sub
  18.  
  19. Sub Send_Five_Emails()
  20. For i = 1 To 5 'Send email 5 times
  21. Call Send_Emails
  22. Next i
  23. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement